Skip to main content

AssetLoader

Trait AssetLoader 

pub trait AssetLoader<S>
where S: Copy,
{ type Asset: 'static + Send + Sync; type SelfWithAnotherLifetime<'r>: 'r + AssetLoader<S, Asset = Self::Asset>; // Required methods fn create_loader<'r>( res: ResourcesHolderMut<'r>, ) -> Option<Self::SelfWithAnotherLifetime<'r>>; fn load_from_serialized( &mut self, ctx: SerializerCtx<'_, S>, value: &SerializedValue, assets_dir_path: impl AsRef<Path>, ) -> Option<Self::Asset>; fn get_related_asset_storage( &mut self, ) -> &mut AssetStorageResource<Self::Asset>; // Provided method fn get_or_load_from_key( &mut self, ctx: SerializerCtx<'_, S>, key: &str, assets_dir_path: impl AsRef<Path>, ) -> Option<AssetHandle<Self::Asset>> { ... } }

Required Associated Types§

type Asset: 'static + Send + Sync

type SelfWithAnotherLifetime<'r>: 'r + AssetLoader<S, Asset = Self::Asset>

Required Methods§

fn create_loader<'r>( res: ResourcesHolderMut<'r>, ) -> Option<Self::SelfWithAnotherLifetime<'r>>

fn load_from_serialized( &mut self, ctx: SerializerCtx<'_, S>, value: &SerializedValue, assets_dir_path: impl AsRef<Path>, ) -> Option<Self::Asset>

Provided Methods§

fn get_or_load_from_key( &mut self, ctx: SerializerCtx<'_, S>, key: &str, assets_dir_path: impl AsRef<Path>, ) -> Option<AssetHandle<Self::Asset>>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§