Apologies, here's the rest of my message: the error is.
src/server.rs:36:22: 36:35 error: type `&mut Self` does not implement any method in scope named `read_le_u16` src/server.rs:36 let n = self.read_le_u16().unwrap(); I'm intending to bound the type of the trait to Reader but I'm not sure I'm doing the right thing. Would you know where I'm wrong? Thanks & best, ~ On 3 May 2014 23:26, Thomas Hunger <[email protected]> wrote: > Hi, > > I'm currently trying to implement a protocol in rust nightly [1]. The > (stylized) code looks like this: > > [...] > > trait PlanReader<R: io::Reader> { > // read [s] type > fn read_9p_s(&mut self) -> io::IoResult<~str> { > let n = self.read_le_u16().unwrap(); > let s = str::from_chars(self.chars().take(n)).unwrap(); > return result::Ok(s); > } > } > [...] > > but it throws an error on compiling: > > > [1] > $ rustc -v > rustc 0.11-pre-nightly (5c0abea 2014-05-01 00:56:48 -0700) > host: x86_64-unknown-linux-gnu > >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
