Read

Trait Read 

Source
pub trait Read {
    // Required method
    fn read(&self, buf: &mut [u8], offset: usize) -> Result<usize, Error>;
}
Expand description

To make a lazy reader cursor from scratch, this trait must be implemented. See Cursor::new about how to create a cursor based on this trait.

Required Methods§

Source

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

Pull some bytes from this source into the specified buffer with offset, returning how many bytes were read.

Implementors§

Source§

impl Read for Vec<u8>

an example about how to build a cursor from Vec<u8>