pub trait AssetField<K>: Clone + Sized + Send + Sync + 'static {
    type Info: DeserializeOwned;
    type Decoded: Send + Sync;
    type DecodeError: Error + Send + Sync + 'static;
    type BuildError: Error + Send + Sync + 'static;
    type Fut: Future<Output = Result<Self::Decoded, Self::DecodeError>> + Send;
    fn decode(info: Self::Info, loader: &Loader) -> Self::Fut;
}
Expand description

This trait is used by code generated by Asset and AssetField derive macros. Types must implement AssetField in order to be usable as field types in structures that derive Asset or AssetField.

Particularly AssetField<Container> implementations can be used as types for fields with #[container] attribute. And AssetField<External> implementations can be used as types or fields with #[external] attribute. AssetField<K> with any other K have no effect for this crate.

Associated Types

Deserializable information about asset field.

Decoded representation of this asset.

Decoding error.

Building error.

Future that will resolve into decoded asset when ready.

Required methods

Implementations on Foreign Types

Implementors