pub trait AssetType: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn loader(&self) -> Box<dyn AssetDataLoader>;
fn saver(&self) -> Box<dyn AssetDataSaver>;
}Expand description
Defines how a specific type of asset should be loaded and saved.
Asset types provide the metadata and behavior for handling different kinds of assets. Each asset type has a unique name and provides factories for creating loaders and savers.
Required Methods§
Sourcefn loader(&self) -> Box<dyn AssetDataLoader>
fn loader(&self) -> Box<dyn AssetDataLoader>
Creates a new loader instance for this asset type.
The loader is responsible for converting raw bytes into asset data.
Sourcefn saver(&self) -> Box<dyn AssetDataSaver>
fn saver(&self) -> Box<dyn AssetDataSaver>
Creates a new saver instance for this asset type.
The saver is responsible for converting asset data back to raw bytes.