Trait tiny_std::io::Read

source ·
pub trait Read {
    // Required method
    fn read(&mut self, buf: &mut [u8]) -> Result<usize>;

    // Provided methods
    fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> { ... }
    fn read_to_string(&mut self, buf: &mut String) -> Result<usize> { ... }
    fn read_exact(&mut self, buf: &mut [u8]) -> Result<()> { ... }
    fn by_ref(&mut self) -> &mut Self
       where Self: Sized { ... }
}

Required Methods§

source

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

Read into to provided buffer

Errors

Eventual Errors specific to the implementation

Provided Methods§

source

fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>

Reads to the end of this Reader,

Errors

Eventual Errors specific to the implementation

source

fn read_to_string(&mut self, buf: &mut String) -> Result<usize>

Reads to the end of the provided buffer

Errors

Eventual Errors specific to the implementation

source

fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>

Reads exactly enough bytes to fill the buffer

Errors

Eventual Errors specific to the implementation

source

fn by_ref(&mut self) -> &mut Selfwhere Self: Sized,

Get this reader by mut ref

Errors

Eventual Errors specific to the implementation

Implementors§