Skip to main content

AssetProcessor

Trait AssetProcessor 

Source
pub trait AssetProcessor<A: Asset>:
    Send
    + Sync
    + 'static {
    // Required methods
    fn process(&self, asset: &mut A, path: &AssetPath) -> Result<(), String>;
    fn name(&self) -> &str;
}
Expand description

Post-processes an asset after it is first loaded.

Examples: generating mip-maps for images, building a BVH for meshes, packing glyphs into a texture atlas for fonts.

Required Methods§

Source

fn process(&self, asset: &mut A, path: &AssetPath) -> Result<(), String>

Mutate or replace the asset in-place.

Source

fn name(&self) -> &str

Human-readable name used in debug output.

Implementors§