pub(crate) struct ASSETS {
pub(crate) __private_field: (),
}Expand description
The HashMap where all loaded assets are stored in.
Fields§
§__private_field: ()Methods from Deref<Target = CombinedCache>§
pub fn as_cache(&self) -> &AssetCache
Sourcepub fn combine<T: Concatenate>(
&self,
cache: &AssetCache,
load_from: impl FnMut(&AssetCache) -> Result<T, Error>,
) -> Result<T, Error>
pub fn combine<T: Concatenate>( &self, cache: &AssetCache, load_from: impl FnMut(&AssetCache) -> Result<T, Error>, ) -> Result<T, Error>
Combine objects from filesystem and plugins
Sourcepub fn register_tar(&self, path: PathBuf) -> Result<()>
pub fn register_tar(&self, path: PathBuf) -> Result<()>
Add a tar archive (a plugin) to the system. All files in that tar file become potential assets.
pub fn no_record<T>(&self, f: impl FnOnce() -> T) -> T
pub fn load_rec_dir<A: DirLoadable + Asset>( &self, id: &str, ) -> Result<&Handle<RecursiveDirectory<A>>, Error>
pub fn load<A: Asset>(&self, id: &str) -> Result<&Handle<A>, Error>
pub fn get_or_insert<A: Storable>(&self, id: &str, a: A) -> &Handle<A>
pub fn load_owned<A: Asset>(&self, id: &str) -> Result<A, Error>
Trait Implementations§
Source§impl Deref for ASSETS
impl Deref for ASSETS
Source§type Target = CombinedCache
type Target = CombinedCache
The resulting type after dereferencing.
Source§fn deref(&self) -> &CombinedCache
fn deref(&self) -> &CombinedCache
Dereferences the value.
impl LazyStatic for ASSETS
Auto Trait Implementations§
impl Freeze for ASSETS
impl RefUnwindSafe for ASSETS
impl Send for ASSETS
impl Sync for ASSETS
impl Unpin for ASSETS
impl UnwindSafe for ASSETS
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more