Trait goods::Format[][src]

pub trait Format<A, K>: Debug + 'static {
    type DecodeFuture: Future<Output = Result<A>> + Send + 'static;
    fn decode(
        self,
        key: K,
        bytes: Box<[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>> + Send + 'static[src]

Decoding future.

Loading content...

Required methods

fn decode(
    self,
    key: K,
    bytes: Box<[u8]>,
    cache: &Cache<K>
) -> Self::DecodeFuture
[src]

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: Send + 'static,
    F: SimpleFormat<A, K> + 'static, 
[src]

type DecodeFuture = Ready<Result<A>>

Loading content...