AssetSource

Trait AssetSource 

Source
pub trait AssetSource {
    // Required methods
    fn open<'a>(
        &'a self,
        path: &str,
    ) -> Result<Box<dyn AssetRead + 'a>, AssetError>;
    fn exists(&self, path: &str) -> bool;
    fn list(&self, dir: &str) -> Result<AssetIter, AssetError>;
}
Expand description

Source of assets such as fonts or images.

Required Methods§

Source

fn open<'a>(&'a self, path: &str) -> Result<Box<dyn AssetRead + 'a>, AssetError>

Open an asset by logical path, e.g., "fonts/regular.bin".

Source

fn exists(&self, path: &str) -> bool

Determine whether an asset at path exists.

Source

fn list(&self, dir: &str) -> Result<AssetIter, AssetError>

List the contents of dir, returning an iterator over asset entries.

Implementors§