pub trait AssetLoader<A: Asset> {
// Required method
fn load(&self, bytes: &[u8]) -> Result<A, Box<dyn Error + Send + Sync>>;
}
Expand description
A trait for types that can load a specific kind of asset from a byte slice.
This represents the “Data Plane” part of asset loading. Implementors of this trait are responsible for the potentially CPU-intensive work of parsing and decoding raw file data into a usable, engine-ready asset type.
Each AssetLoader
is specialized for a single asset type A
.