Struct amethyst_assets::Cache [−][src]
pub struct Cache<A> { /* fields omitted */ }A simple cache for asset handles of type A.
This stores WeakHandle, so it doesn't keep the assets alive.
Methods
impl<A> Cache<A> where
A: Clone, [src]
impl<A> Cache<A> where
A: Clone, pub fn new() -> Self[src]
pub fn new() -> SelfCreates a new Cache and initializes it with the default values.
pub fn insert<K: Into<String>>(
&mut self,
key: K,
asset: &Handle<A>
) -> Option<WeakHandle<A>>[src]
pub fn insert<K: Into<String>>(
&mut self,
key: K,
asset: &Handle<A>
) -> Option<WeakHandle<A>>Inserts an asset with a given key and returns the old value (if any).
pub fn get<K: ?Sized>(&self, key: &K) -> Option<Handle<A>> where
K: Hash + Eq,
String: Borrow<K>, [src]
pub fn get<K: ?Sized>(&self, key: &K) -> Option<Handle<A>> where
K: Hash + Eq,
String: Borrow<K>, Retrieves an asset handle using a given key.
pub fn clear_dead<F>(&mut self)[src]
pub fn clear_dead<F>(&mut self)Deletes all cached handles which are invalid.
pub fn clear_all(&mut self)[src]
pub fn clear_all(&mut self)Clears all values.