Trait de_objects::collection::AssetCollectionLoader

source ·
pub(crate) trait AssetCollectionLoader
where Self: Sized + AssetCollection, Self::Key: Eq + Hash + FileStem + Sequence,
{ const DIRECTORY: &'static str; const SUFFIX: &'static str; // Required methods fn new(map: AHashMap<Self::Key, Handle<Self::Asset>>) -> Self; fn label() -> Option<String>; // Provided methods fn init(server: &AssetServer) -> Self { ... } fn progress(&self, server: &AssetServer) -> Progress { ... } }

Required Associated Constants§

source

const DIRECTORY: &'static str

source

const SUFFIX: &'static str

Required Methods§

source

fn new(map: AHashMap<Self::Key, Handle<Self::Asset>>) -> Self

source

fn label() -> Option<String>

Return asset label to be passed to the asset server to load all assets from the collection.

Provided Methods§

source

fn init(server: &AssetServer) -> Self

Initialize the collection by (starting) loading of all assets of the collection.

source

fn progress(&self, server: &AssetServer) -> Progress

Returns progress of the loading.

It shall not be called before Self::init.

§Panics

Panics if loading any of the assets is either failed or unknown.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl AssetCollectionLoader for Scenes

source§

const DIRECTORY: &'static str = "models"

source§

const SUFFIX: &'static str = "glb"

source§

impl AssetCollectionLoader for Solids

source§

const DIRECTORY: &'static str = "objects"

source§

const SUFFIX: &'static str = _