Skip to main content

AssetSource

Trait AssetSource 

Source
pub trait AssetSource:
    'static
    + Send
    + Sync {
    // Required methods
    fn load(&self, path: &str) -> Result<Option<Cow<'static, [u8]>>>;
    fn list(&self, path: &str) -> Result<Vec<SharedString>>;
}
Expand description

A source of assets for this app to use.

Required Methods§

Source

fn load(&self, path: &str) -> Result<Option<Cow<'static, [u8]>>>

Load the given asset from the source path.

Source

fn list(&self, path: &str) -> Result<Vec<SharedString>>

List the assets at the given path.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl AssetSource for ()

Source§

fn load(&self, _path: &str) -> Result<Option<Cow<'static, [u8]>>>

Source§

fn list(&self, _path: &str) -> Result<Vec<SharedString>>

Implementors§