pub struct CombinedCache(AssetCache);Expand description
A cache combining filesystem and plugin assets
Tuple Fields§
§0: AssetCacheImplementations§
Source§impl CombinedCache
impl CombinedCache
pub fn new() -> Result<Self>
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>
Auto Trait Implementations§
impl !RefUnwindSafe for CombinedCache
impl !UnwindSafe for CombinedCache
impl Freeze for CombinedCache
impl Send for CombinedCache
impl Sync for CombinedCache
impl Unpin for CombinedCache
impl UnsafeUnpin 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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