Skip to main content

ErasedAssetSaver

Trait ErasedAssetSaver 

Source
pub trait ErasedAssetSaver:
    Send
    + Sync
    + 'static {
    // Required methods
    fn save<'a>(
        &'a self,
        writer: &'a mut Writer,
        asset: &'a ErasedLoadedAsset,
        settings: &'a dyn Settings,
        asset_path: AssetPath<'a>,
    ) -> BoxedFuture<'a, Result<(), BevyError>>;
    fn type_name(&self) -> &'static str;
}
Expand description

A type-erased dynamic variant of AssetSaver that allows callers to save assets without knowing the actual type of the AssetSaver.

Required Methods§

Source

fn save<'a>( &'a self, writer: &'a mut Writer, asset: &'a ErasedLoadedAsset, settings: &'a dyn Settings, asset_path: AssetPath<'a>, ) -> BoxedFuture<'a, Result<(), BevyError>>

Saves the given runtime ErasedLoadedAsset by writing it to a byte format using writer. The passed in settings can influence how the asset is saved.

Source

fn type_name(&self) -> &'static str

The type name of the AssetSaver.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§