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>

source

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,

source

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,

source

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,

source§

fn load(cache: AnyCache<'_>, id: &SharedString) -> Result<Self, BoxedError>

Loads an asset from the cache. Read more
source§

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.
source§

impl<T> Debug for RecursiveDirectory<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<S> FromSample<S> for S

source§

fn from_sample_(s: S) -> S

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Storable for T
where T: Compound,

source§

fn get_type(_: Private) -> Type

source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

source§

fn to_sample_(self) -> U

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,