Trait utf8_io::ReadStr[][src]

pub trait ReadStr: Read {
    fn read_str(&mut self, buf: &mut str) -> Result<usize>;

    fn read_exact_str(&mut self, buf: &mut str) -> Result<()> { ... }
}

Extend the Read trait with read_str, a method for reading UTF-8 data.

Required methods

fn read_str(&mut self, buf: &mut str) -> Result<usize>[src]

Like read but produces the result in a str. Be sure to check the size field of the return value to see how many bytes were written.

buf must be at least 4 bytes long, so that any valid UTF-8 codepoint can be read.

Loading content...

Provided methods

fn read_exact_str(&mut self, buf: &mut str) -> Result<()>[src]

Like read_exact but produces the result in a str.

Loading content...

Implementors

impl<Inner: Read> ReadStr for Utf8Reader<Inner>[src]

impl<Inner: HalfDuplex> ReadStr for Utf8Duplexer<Inner>[src]

Loading content...