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§

source

fn key(&self) -> String

source

fn long_name(&self) -> String

source

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,

source

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

source

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

Implementors§

source§

impl<T: Asset + Clone + Sync + Send + 'static, K: AsyncAssetKey<T> + Clone + 'static> AsyncAssetKeyExt<T> for K