Trait immeta::LoadableMetadata [] [src]

pub trait LoadableMetadata: Sized {
    fn load<R: ?Sized + BufRead>(r: &mut R) -> Result<Self>;

    fn load_from_seek<R: ?Sized + BufRead + Seek>(r: &mut R) -> Result<Self> { ... }
    fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self> { ... }
    fn load_from_buf(buf: &[u8]) -> Result<Self> { ... }
}

Provides several convenience functions for loading metadata from various sources.

Required Methods

fn load<R: ?Sized + BufRead>(r: &mut R) -> Result<Self>

Loads the implementing type from the given buffered input stream.

Provided Methods

fn load_from_seek<R: ?Sized + BufRead + Seek>(r: &mut R) -> Result<Self>

Loads the implementing type from the given buffered and seekable input stream.

Delegates to LoadableMetadata::load() method by default. Implementations may override this behavior if their respective image format may be parsed more efficiently with seeking.

fn load_from_file<P: AsRef<Path>>(path: P) -> Result<Self>

Loads the implementing type from a file specified by the given path.

Delegates to LoadableMetadata::load_from_seek() method by default.

fn load_from_buf(buf: &[u8]) -> Result<Self>

Loads the implementing type from an in-memory buffer.

Delegates to LoadableMetadata::load_from_seek() method by default.

Implementors