Trait amethyst_assets::Format
[−]
[src]
pub trait Format<A: Asset>: Send + 'static { type Options: Send + 'static; const NAME: &'static str; fn import(
&self,
name: String,
source: Arc<Source>,
options: Self::Options,
create_reload: bool
) -> Result<FormatValue<A>>; }
A format, providing a conversion from bytes to asset data, which is then
in turn accepted by Asset::from_data
. Examples for formats are
Png
, Obj
and Wave
.
Associated Types
type Options: Send + '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,
name: String,
source: Arc<Source>,
options: Self::Options,
create_reload: bool
) -> Result<FormatValue<A>>
&self,
name: String,
source: Arc<Source>,
options: Self::Options,
create_reload: bool
) -> Result<FormatValue<A>>
Reads the given bytes and produces asset data.
Reload
The reload structure has metadata which allows the asset management
to reload assets if necessary (for hot reloading).
You should only create this if create_reload
is true
.
Also, the parameter is just a request, which means you can also return None
.