[][src]Trait codec_io::Input

pub trait Input {
    type Error;
    fn read(&mut self, into: &mut [u8]) -> Result<(), Self::Error>;

    fn read_byte(&mut self) -> Result<u8, Self::Error> { ... }
}

Trait that allows reading of data into a slice.

Associated Types

type Error

Error type of this input.

Loading content...

Required methods

fn read(&mut self, into: &mut [u8]) -> Result<(), Self::Error>

Read the exact number of bytes required to fill the given buffer.

Note that this function is similar to std::io::Read::read_exact and not std::io::Read::read.

Loading content...

Provided methods

fn read_byte(&mut self) -> Result<u8, Self::Error>

Read a single byte from the input.

Loading content...

Implementors

impl<R: Read> Input for R[src]

type Error = Error

Loading content...