[−][src]Trait goods::Format
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 Error: Error + MaybeSend + MaybeSync + 'static
Error that may occur during asset loading.
type DecodeFuture: Future<Output = Result<A::Repr, Self::Error>> + MaybeSend + 'static
Asynchronous result produced by the format loading.
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.
Implementors
impl<A, K> Format<A, K> for JsonFormat where
A: Asset,
A::Repr: DeserializeOwned,
[src]
A: Asset,
A::Repr: DeserializeOwned,
type Error = Error
type DecodeFuture = Ready<Result<A::Repr, Self::Error>>
fn decode(
self,
bytes: Vec<u8>,
_cache: &Cache<K>
) -> Ready<Result<A::Repr, Error>>
[src]
self,
bytes: Vec<u8>,
_cache: &Cache<K>
) -> Ready<Result<A::Repr, Error>>
impl<A, K> Format<A, K> for PassthroughFormat where
A: Asset,
A::Repr: From<Vec<u8>>,
[src]
A: Asset,
A::Repr: From<Vec<u8>>,
type Error = Infallible
type DecodeFuture = Ready<Result<A::Repr, Infallible>>
fn decode(
self,
bytes: Vec<u8>,
_cache: &Cache<K>
) -> Ready<Result<A::Repr, Infallible>>
[src]
self,
bytes: Vec<u8>,
_cache: &Cache<K>
) -> Ready<Result<A::Repr, Infallible>>
impl<A, K> Format<A, K> for RonFormat where
A: Asset,
A::Repr: DeserializeOwned,
[src]
A: Asset,
A::Repr: DeserializeOwned,
type Error = Error
type DecodeFuture = Ready<Result<A::Repr, Self::Error>>
fn decode(
self,
bytes: Vec<u8>,
_cache: &Cache<K>
) -> Ready<Result<A::Repr, Error>>
[src]
self,
bytes: Vec<u8>,
_cache: &Cache<K>
) -> Ready<Result<A::Repr, Error>>
impl<A, K> Format<A, K> for YamlFormat where
A: Asset,
A::Repr: DeserializeOwned,
[src]
A: Asset,
A::Repr: DeserializeOwned,