pub trait AsyncAssetKey<T: Asset + Clone + Sync + Send + 'static>: Sync + Send + Debug {
    // Required method
    fn load<'async_trait>(
        self,
        assets: AssetCache
    ) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>
       where Self: 'async_trait;

    // Provided methods
    fn in_background(self) -> BackgroundKey<Self>
       where Self: Sized { ... }
    fn keepalive(&self) -> AssetKeepalive { ... }
    fn drop_policy(&self) -> AssetLoadDropPolicy { ... }
    fn cpu_size(&self, _asset: &T) -> Option<u64> { ... }
    fn gpu_size(&self, _asset: &T) -> Option<u64> { ... }
}

Required Methods§

source

fn load<'async_trait>( self, assets: AssetCache ) -> Pin<Box<dyn Future<Output = T> + Send + 'async_trait>>where Self: 'async_trait,

Provided Methods§

source

fn in_background(self) -> BackgroundKey<Self>where Self: Sized,

Adapter to make the key load in a background task.

This allows get and load to work outside the tokio runtime.

It also prevents the loading from being aborted

source

fn keepalive(&self) -> AssetKeepalive

source

fn drop_policy(&self) -> AssetLoadDropPolicy

source

fn cpu_size(&self, _asset: &T) -> Option<u64>

source

fn gpu_size(&self, _asset: &T) -> Option<u64>

Implementors§