Trait ntfs::NtfsReadSeek

source ·
pub trait NtfsReadSeek {
    // Required methods
    fn read<T>(&mut self, fs: &mut T, buf: &mut [u8]) -> Result<usize>
       where T: Read + Seek;
    fn seek<T>(&mut self, fs: &mut T, pos: SeekFrom) -> Result<u64>
       where T: Read + Seek;
    fn stream_position(&self) -> u64;

    // Provided method
    fn read_exact<T>(&mut self, fs: &mut T, buf: &mut [u8]) -> Result<()>
       where T: Read + Seek { ... }
}
Expand description

Trait to read/seek in a source by the help of a temporarily passed mutable reference to the filesystem reader.

By requiring the user to pass the filesystem reader on every read, we circumvent the problems associated with permanently holding a mutable reference. If we held one, we could not read from two objects in alternation.

Required Methods§

source

fn read<T>(&mut self, fs: &mut T, buf: &mut [u8]) -> Result<usize>where T: Read + Seek,

source

fn seek<T>(&mut self, fs: &mut T, pos: SeekFrom) -> Result<u64>where T: Read + Seek,

source

fn stream_position(&self) -> u64

Provided Methods§

source

fn read_exact<T>(&mut self, fs: &mut T, buf: &mut [u8]) -> Result<()>where T: Read + Seek,

Implementors§