[][src]Trait goods::Format

pub trait Format<A: Asset, K>: Send + 'static {
    type DecodeFuture: Future<Output = Result<A::Repr, A::Error>> + Send + 'static;
    fn decode(self, bytes: Vec<u8>, cache: &Cache<K>) -> Self::DecodeFuture;
}

Format trait interprets raw bytes as an asset. It may also use context for asset instance creation and Cache to load compound assets.

Associated Types

type DecodeFuture: Future<Output = Result<A::Repr, A::Error>> + Send + 'static

Asynchronous result produced by the format loading.

Loading content...

Required methods

fn decode(self, bytes: Vec<u8>, cache: &Cache<K>) -> Self::DecodeFuture

Decode asset intermediate representation from raw data using cache to fetch sub-assets.

Loading content...

Implementors

impl<A, K, F> Format<A, K> for F where
    A: Asset,
    F: LeafFormat<A, K>, 
[src]

type DecodeFuture = Ready<Result<A::Repr, A::Error>>

Loading content...