pub trait AsyncAssetKeyExt<T: Asset + Clone + Sync + Send + 'static>: AsyncAssetKey<T> {
// Required methods
fn key(&self) -> String;
fn long_name(&self) -> String;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
assets: &'life1 AssetCache
) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn is_loaded(&self, assets: &AssetCache) -> Option<T>;
fn peek(&self, assets: &AssetCache) -> Option<T>;
}
Required Methods§
fn key(&self) -> String
fn long_name(&self) -> String
fn get<'life0, 'life1, 'async_trait>( &'life0 self, assets: &'life1 AssetCache ) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
sourcefn is_loaded(&self, assets: &AssetCache) -> Option<T>
fn is_loaded(&self, assets: &AssetCache) -> Option<T>
Returns Some(T)
if the asset is currently loaded, alive, and well.
Does not attempt to load the asset in any way
sourcefn peek(&self, assets: &AssetCache) -> Option<T>
fn peek(&self, assets: &AssetCache) -> Option<T>
If the asset is loaded, it will be returned. Otherwise, the loading will start loading in the background, and None will be returned