Trait bevy::asset::AssetLoader
pub trait AssetLoader: Send + Sync + 'static {
// Required methods
fn load<'a>(
&'a self,
bytes: &'a [u8],
load_context: &'a mut LoadContext<'_>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a, Global>>;
fn extensions(&self) -> &[&str];
}
Expand description
A loader for an asset source.
Types implementing this trait are used by the asset server to load assets into their respective asset storages.
Required Methods§
fn load<'a>(
&'a self,
bytes: &'a [u8],
load_context: &'a mut LoadContext<'_>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a, Global>>
fn load<'a>( &'a self, bytes: &'a [u8], load_context: &'a mut LoadContext<'_> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'a, Global>>
Processes the asset in an asynchronous closure.
fn extensions(&self) -> &[&str]
fn extensions(&self) -> &[&str]
Returns a list of extensions supported by this asset loader, without the preceding dot.