Trait AssetSource

Source
pub trait AssetSource {
    // Required methods
    fn has(&self, path: &str) -> Result<bool, LoaderError>;
    fn load(&self, path: &str) -> Result<Option<Vec<u8>>, LoaderError>;
}
Expand description

Trait for the various sources that assets can be loaded from

Required Methods§

Source

fn has(&self, path: &str) -> Result<bool, LoaderError>

Check if a path exists in the source

Source

fn load(&self, path: &str) -> Result<Option<Vec<u8>>, LoaderError>

Load an asset from the source by path if it exists

Implementations on Foreign Types§

Source§

impl AssetSource for PathBuf

Source§

fn has(&self, path: &str) -> Result<bool, LoaderError>

Source§

fn load(&self, path: &str) -> Result<Option<Vec<u8>>, LoaderError>

Source§

impl AssetSource for VPK

Source§

fn has(&self, path: &str) -> Result<bool, LoaderError>

Source§

fn load(&self, path: &str) -> Result<Option<Vec<u8>>, LoaderError>

Implementors§