Skip to main content

InfileBase

Trait InfileBase 

Source
pub trait InfileBase {
    // Required methods
    fn read(&mut self, buf: &mut [u8]) -> Result<usize>;
    fn seek(&mut self, offset: i64, whence: SeekFrom) -> Result<()>;
    fn tell(&self) -> i64;
    fn eof(&self) -> bool;
}
Expand description

Trait for sequential / seekable input streams — port of infile_base.

Required Methods§

Source

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

Reads up to buf.len() bytes, returning the count actually read.

Source

fn seek(&mut self, offset: i64, whence: SeekFrom) -> Result<()>

Seeks to the given offset from whence.

Source

fn tell(&self) -> i64

Returns the current byte position.

Source

fn eof(&self) -> bool

Returns true when the end of the stream has been reached.

Implementors§