Struct veloren_common_assets::plugin_cache::CombinedCache
source · pub struct CombinedCache(AssetCache<CombinedSource>);
Expand description
A cache combining filesystem and plugin assets
Tuple Fields§
§0: AssetCache<CombinedSource>
Implementations§
source§impl CombinedCache
impl CombinedCache
pub fn new() -> Result<Self>
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>
Auto Trait Implementations§
impl !Freeze for CombinedCache
impl RefUnwindSafe for CombinedCache
impl Send for CombinedCache
impl Sync for CombinedCache
impl Unpin for CombinedCache
impl UnwindSafe for CombinedCache
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