Struct rofl::CachingLoader
[−]
[src]
pub struct CachingLoader<L: Loader> { /* fields omitted */ }
A loader that keeps a cache of resources previously loaded.
Methods
impl<L: Loader> CachingLoader<L>
[src]
impl<L: Loader> CachingLoader<L>
[src]
fn cache(&self) -> &ThreadSafeCache<String, L::Item>
Returns a reference to the loader's cache.
Trait Implementations
impl<L: Loader> Loader for CachingLoader<L>
[src]
type Item = Arc<L::Item>
Type of resources that this loader can load.
type Err = L::Err
Error that may occur while loading the resource.
fn load<'n>(&self, name: &'n str) -> Result<Self::Item, Self::Err>
Load the object from cache or fall back on the original Loader. Cache the objects loaded this way.