Skip to main content

Asset

Trait Asset 

Source
pub trait Asset: 'static {
    type Source: Clone + Hash + Send;
    type Output: Clone + Send;

    // Required method
    fn load(
        source: Self::Source,
        cx: &mut App,
    ) -> impl Future<Output = Self::Output> + Send + 'static;
}
Expand description

A trait for asynchronous asset loading.

Required Associated Types§

Source

type Source: Clone + Hash + Send

The source of the asset.

Source

type Output: Clone + Send

The loaded asset

Required Methods§

Source

fn load( source: Self::Source, cx: &mut App, ) -> impl Future<Output = Self::Output> + Send + 'static

Load the asset asynchronously

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§