AssetRead

Trait AssetRead 

Source
pub trait AssetRead {
    // Required methods
    fn read(&mut self, out: &mut [u8]) -> Result<usize, AssetError>;
    fn len(&self) -> usize;
    fn is_empty(&self) -> bool;
    fn seek(&mut self, pos: u64) -> Result<u64, AssetError>;
}
Expand description

Reader trait for streaming asset data.

Required Methods§

Source

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

Read data into out, returning the number of bytes read.

Source

fn len(&self) -> usize

Total length of the asset in bytes.

Source

fn is_empty(&self) -> bool

Return true if the asset has a length of zero bytes.

Source

fn seek(&mut self, pos: u64) -> Result<u64, AssetError>

Seek to an absolute byte position within the asset.

Implementors§