[][src]Trait capnp::io::Read

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

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

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

Required methods

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

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.

Loading content...

Provided methods

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

Loading content...


impl<R> Read for R where
    R: Read

Loading content...