Struct ambient_asset_cache::AssetCache
source · pub struct AssetCache {
pub timeline: Arc<Mutex<AssetsTimeline>>,
/* private fields */
}
Fields§
§timeline: Arc<Mutex<AssetsTimeline>>
Implementations§
source§impl AssetCache
impl AssetCache
pub fn new(runtime: impl Into<RuntimeHandle>) -> Self
pub fn new_with_config( runtime: impl Into<RuntimeHandle>, max_keepalive: Option<Duration> ) -> Self
pub fn get_sync<K: Into<String>, T: Clone + Sync + Send + 'static>( &self, key: K, loader: impl FnOnce(AssetCache) -> T + Sync + Send ) -> T
👎Deprecated: Use a SyncAssetKey instead
pub fn try_get_sync<K: Into<String>, T: Clone + Sync + Send + 'static>( &self, key: K ) -> Option<T>
👎Deprecated: Use a SyncAssetKey instead
pub fn contains_sync<K: Into<String>>(&self, key: K) -> bool
👎Deprecated: Use a SyncAssetKey instead
sourcepub fn insert<K: Into<String>, T: Clone + Sync + Send + 'static>(
&self,
key: K,
asset: T
)
👎Deprecated: Use a SyncAssetKey instead
pub fn insert<K: Into<String>, T: Clone + Sync + Send + 'static>( &self, key: K, asset: T )
Use try_get_sync to retreive again
pub fn runtime(&self) -> &RuntimeHandle
Trait Implementations§
source§impl Clone for AssetCache
impl Clone for AssetCache
source§fn clone(&self) -> AssetCache
fn clone(&self) -> AssetCache
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AssetCache
impl Send for AssetCache
impl Sync for AssetCache
impl Unpin for AssetCache
impl !UnwindSafe for AssetCache
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