Trait SeekRead

Source
pub trait SeekRead {
    // Required method
    fn seek_read(&mut self, out: &mut [u8], offset: u64) -> Result<usize, Error>;

    // Provided method
    fn seek_read_all(
        &mut self,
        out: &mut [u8],
        offset: u64,
    ) -> Result<(), Error> { ... }
}
Expand description

Trait to permit an atomic Seek+Read operation

Required Methods§

Source

fn seek_read(&mut self, out: &mut [u8], offset: u64) -> Result<usize, Error>

Seek to the offset, relative to the start of the stream, and read some bytes into the provided buffer. The number of bytes read is returned.

Provided Methods§

Source

fn seek_read_all(&mut self, out: &mut [u8], offset: u64) -> Result<(), Error>

Reads all data from the offset into the provided buffer. May require multiple file ops & seeks if the calls do not read all the data.

Implementations on Foreign Types§

Source§

impl SeekRead for File

Available on crate feature std only.
Source§

fn seek_read(&mut self, out: &mut [u8], offset: u64) -> Result<usize, Error>

Implementors§