Trait goods::Asset[][src]

pub trait Asset: Clone + Sized + 'static {
    type Error: Error + Send + Sync;
    type Repr;
    type Context;
    type BuildFuture: Future<Output = Result<Self, Self::Error>> + 'static;
    fn build(repr: Self::Repr, ctx: &mut Self::Context) -> Self::BuildFuture;
}

Loaded, processed and prepared asset. This trait specifies how asset instances can be built from intermediate values that are produced by Format implemetations.

Associated Types

type Error: Error + Send + Sync[src]

Error that may occur during asset building.

type Repr[src]

Intermediate representation type for the asset. This representation is constructed by Format::decode.

type Context[src]

Asset processing context. Instance of context is required to convert asset intermediate representation into asset instance. Special context type PhantomContext can be specified if no context is required, reducing overhead and making asset building occur faster.

type BuildFuture: Future<Output = Result<Self, Self::Error>> + 'static[src]

Asynchronous result produced by asset building.

Loading content...

Required methods

fn build(repr: Self::Repr, ctx: &mut Self::Context) -> Self::BuildFuture[src]

Build asset instance from intermediate representation using provided context.

Loading content...

Implementors

impl<S> Asset for S where
    S: SyncAsset
[src]

type Error = S::Error

type Repr = S::Repr

type Context = S::Context

type BuildFuture = Ready<Result<Self, Self::Error>>

Loading content...