Trait amethyst_assets::SimpleFormat
[−]
[src]
pub trait SimpleFormat<A: Asset> { type Options: Clone + Send + Sync + 'static; const NAME: &'static str; fn import(&self, bytes: Vec<u8>, options: Self::Options) -> Result<A::Data>; }
This is a simplified version of Format
, which doesn't give you as much freedom,
but in return is simpler to implement.
All SimpleFormat
types automatically implement Format
.
This format assumes that the asset name is the full path and the asset is only
contained in one file.
Associated Types
type Options: Clone + Send + Sync + 'static
Options specific to the format, which are passed to import
.
E.g. for textures this would be stuff like mipmap levels and
sampler info.
Associated Constants
Required Methods
fn import(&self, bytes: Vec<u8>, options: Self::Options) -> Result<A::Data>
Produces asset data from given bytes.