Trait binver::Reader[][src]

pub trait Reader<'a> {
    fn version(&self) -> Version;
fn read(&mut self, bytes: &mut [u8]) -> ReadResult;
fn read_slice(&mut self, len: usize) -> ReadResult<&'a [u8]>; }
Expand description

Generic reader

Required methods

Return the version of the format being read.

Fill the given slice with bytes. All bytes must be read.

Read a slice of length len from the reader. Must be return exactly the amount of bytes being requested.

If the reader does not have it’s own internal buffer (e.g. std::fs::File) ReadError::ReaderNotPersistent should be returned.

Implementors