Struct veloren_common_assets::ASSETS
source · 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>§
sourcepub fn combine<T: Concatenate>(
&self,
reloading_cache: AnyCache<'_>,
load_from: impl FnMut(AnyCache<'_>) -> Result<T, Error>,
) -> Result<T, Error>
pub fn combine<T: Concatenate>( &self, reloading_cache: AnyCache<'_>, load_from: impl FnMut(AnyCache<'_>) -> 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 enhance_hot_reloading(&'static self)
pub fn load_rec_dir<A: DirLoadable>( &self, id: &str, ) -> Result<&Handle<RecursiveDirectory<A>>, Error>
pub fn load<A: Compound>(&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: Compound>(&self, id: &str) -> Result<A, Error>
Trait Implementations§
source§impl Deref for ASSETS
impl Deref for ASSETS
§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