pub trait AssetLoader: Send + Sync + 'static {
    // Required methods
    fn load<'a>(
        &'a self,
        bytes: &'a [u8],
        load_context: &'a mut LoadContext<'_>
    ) -> BoxedFuture<'a, Result<(), Error>>;
    fn extensions(&self) -> &[&str];
}
Expand description

A loader for an asset source.

Types implementing this trait are used by the AssetServer to load assets into their respective asset storages.

Required Methods§

source

fn load<'a>( &'a self, bytes: &'a [u8], load_context: &'a mut LoadContext<'_> ) -> BoxedFuture<'a, Result<(), Error>>

Processes the asset in an asynchronous closure.

source

fn extensions(&self) -> &[&str]

Returns a list of extensions supported by this asset loader, without the preceding dot.

Implementors§