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

    fn read_exact(&mut self, buf: &mut [u8]) -> Result<()> { ... }
Expand description

A rough approximation of std::io::Read.

Required Methods

Attempts to read some bytes into buf and returns the number of bytes read. A return value of Ok(0) means that the end of the stream was reached.

Unlike with std::io::Read, implementations are expected to handle EINTR (i.e. std::io::ErrorKind::Interrupted) internally, by looping until either success is achieved or some other error is hit.

Provided Methods