Trait goods::AssetField
source · [−]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
type Info: DeserializeOwned
type Info: DeserializeOwned
Deserializable information about asset field.
type DecodeError: Error + Send + Sync + 'static
type DecodeError: Error + Send + Sync + 'static
Decoding error.
type BuildError: Error + Send + Sync + 'static
type BuildError: Error + Send + Sync + 'static
Building error.