Struct assets_manager::RecursiveDirectory
source · pub struct RecursiveDirectory<T> { /* private fields */ }
Expand description
Stores ids in a recursive directory containing assets of type T
Implementations§
source§impl<T> RecursiveDirectory<T>
impl<T> RecursiveDirectory<T>
sourcepub fn ids(&self) -> impl ExactSizeIterator<Item = &SharedString>
pub fn ids(&self) -> impl ExactSizeIterator<Item = &SharedString>
Returns an iterator over the ids of the assets in the directory.
source§impl<T> RecursiveDirectory<T>where
T: Storable,
impl<T> RecursiveDirectory<T>where
T: Storable,
sourcepub fn iter_cached<'h, 'a: 'h>(
&'h self,
cache: impl AsAnyCache<'a>
) -> impl Iterator<Item = &'a Handle<T>> + 'h
pub fn iter_cached<'h, 'a: 'h>( &'h self, cache: impl AsAnyCache<'a> ) -> impl Iterator<Item = &'a Handle<T>> + 'h
Returns an iterator over the assets in the directory.
This fonction does not do any I/O and assets that previously failed to load are ignored.
source§impl<T> RecursiveDirectory<T>where
T: Compound,
impl<T> RecursiveDirectory<T>where
T: Compound,
sourcepub fn iter<'h, 'a: 'h>(
&'h self,
cache: impl AsAnyCache<'a>
) -> impl ExactSizeIterator<Item = Result<&'a Handle<T>, Error>> + 'h
pub fn iter<'h, 'a: 'h>( &'h self, cache: impl AsAnyCache<'a> ) -> impl ExactSizeIterator<Item = Result<&'a Handle<T>, Error>> + 'h
Returns an iterator over the assets in the directory.
This function will happily try to load all assets, even if an error occured the last time it was tried.
Trait Implementations§
source§impl<T> Compound for RecursiveDirectory<T>where
T: DirLoadable,
impl<T> Compound for RecursiveDirectory<T>where
T: DirLoadable,
source§fn load(cache: AnyCache<'_>, id: &SharedString) -> Result<Self, BoxedError>
fn load(cache: AnyCache<'_>, id: &SharedString) -> Result<Self, BoxedError>
Loads an asset from the cache. Read more
source§const HOT_RELOADED: bool = true
const HOT_RELOADED: bool = true
If
false
, disable hot-reloading for assets of this type (true
by
default). If so, you may want to implement NotHotReloaded
for this
type to enable additional functions.Auto Trait Implementations§
impl<T> Freeze for RecursiveDirectory<T>
impl<T> RefUnwindSafe for RecursiveDirectory<T>where
T: RefUnwindSafe,
impl<T> Send for RecursiveDirectory<T>where
T: Send,
impl<T> Sync for RecursiveDirectory<T>where
T: Sync,
impl<T> Unpin for RecursiveDirectory<T>where
T: Unpin,
impl<T> UnwindSafe for RecursiveDirectory<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more