Struct cachy::Cache
[−]
[src]
pub struct Cache<R> { /* fields omitted */ }
A store of loaded resources
Methods
impl<R> Cache<R>
[src]
fn new() -> Cache<R>
Creates a new Cache
fn load<L: ResourceProvider<R>>(
&mut self,
provider: &L,
key: L::Key
) -> Result<Arc<R>, L::Error>
&mut self,
provider: &L,
key: L::Key
) -> Result<Arc<R>, L::Error>
Use the specified ResourceLoader to load/create a resource, and cache it
fn cache_async(&mut self)
Checks on asynchrous cache requests, and caches them if available
fn load_async<L: ResourceProvider<R> + Send + Sync>(
&mut self,
provider: &L,
key: L::Key
) -> Result<Arc<R>, ResourceFuture<R, L>> where
R: Send + Sync + 'static,
L: Clone + 'static,
&mut self,
provider: &L,
key: L::Key
) -> Result<Arc<R>, ResourceFuture<R, L>> where
R: Send + Sync + 'static,
L: Clone + 'static,
Use the specifed ResourceLoader to load/create a resource on a separate thread, and cache it if successful