Skip to main content

InputFeatures

Trait InputFeatures 

Source
pub trait InputFeatures: Read {
    // Required methods
    fn get_size(&mut self) -> Result<usize, Error>;
    fn try_seek(&mut self, pos: SeekFrom) -> Result<u64, Error>;

    // Provided method
    fn get_unix_mtime(&mut self) -> Result<Option<i64>, Error> { ... }
}
Expand description

An extension to the basic Read trait supporting additional features needed for Tectonic’s I/O system.

Required Methods§

Source

fn get_size(&mut self) -> Result<usize, Error>

Get the size of the stream. Return TectonicIoError::NotSizeable if the operation is not well-defined for this stream.

Source

fn try_seek(&mut self, pos: SeekFrom) -> Result<u64, Error>

Try to seek within the stream. Return TectonicIoError::NotSeekable if the operation is not possible for this stream.

Provided Methods§

Source

fn get_unix_mtime(&mut self) -> Result<Option<i64>, Error>

Get the modification time of this file as a Unix time. If that quantity is not meaningfully defined for this input, return Ok(None). This is what the default implementation does.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl InputFeatures for BufReader<File>

Source§

fn get_size(&mut self) -> Result<usize, Error>

Source§

fn get_unix_mtime(&mut self) -> Result<Option<i64>, Error>

Source§

fn try_seek(&mut self, pos: SeekFrom) -> Result<u64, Error>

Source§

impl InputFeatures for Cursor<SharedByteBuffer>

Source§

fn get_size(&mut self) -> Result<usize, Error>

Source§

fn get_unix_mtime(&mut self) -> Result<Option<i64>, Error>

Source§

fn try_seek(&mut self, pos: SeekFrom) -> Result<u64, Error>

Source§

impl InputFeatures for Cursor<Vec<u8>>

Source§

fn get_size(&mut self) -> Result<usize, Error>

Source§

fn get_unix_mtime(&mut self) -> Result<Option<i64>, Error>

Source§

fn try_seek(&mut self, pos: SeekFrom) -> Result<u64, Error>

Source§

impl InputFeatures for File

Source§

fn get_size(&mut self) -> Result<usize, Error>

Source§

fn get_unix_mtime(&mut self) -> Result<Option<i64>, Error>

Source§

fn try_seek(&mut self, pos: SeekFrom) -> Result<u64, Error>

Source§

impl<R> InputFeatures for GzDecoder<R>
where R: Read,

Implementors§