Trait amethyst_assets::Format
source · pub trait Format<A: Asset>: Send + 'static {
type Options: Send + 'static;
const NAME: &'static str;
fn import(
&self,
name: String,
source: Arc<dyn Source>,
options: Self::Options,
create_reload: bool
) -> Result<FormatValue<A>>;
}
Expand description
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
.
Required Associated Types
Required Associated Constants
Required Methods
sourcefn import(
&self,
name: String,
source: Arc<dyn Source>,
options: Self::Options,
create_reload: bool
) -> Result<FormatValue<A>>
fn import(
&self,
name: String,
source: Arc<dyn 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
.