Trait bevy_asset::AssetLoader
source · 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§
sourcefn load<'a>(
&'a self,
bytes: &'a [u8],
load_context: &'a mut LoadContext<'_>
) -> BoxedFuture<'a, Result<(), Error>>
fn load<'a>( &'a self, bytes: &'a [u8], load_context: &'a mut LoadContext<'_> ) -> BoxedFuture<'a, Result<(), Error>>
Processes the asset in an asynchronous closure.
sourcefn extensions(&self) -> &[&str]
fn extensions(&self) -> &[&str]
Returns a list of extensions supported by this asset loader, without the preceding dot.