Struct warmy::Storage
[−]
[src]
pub struct Storage { /* fields omitted */ }
Resource storage.
This type is responsible of storing resources and giving functions to look them up and update them whenever needed.
Methods
impl Storage
[src]
fn root(&self) -> &Path
[src]
The canonicalized root the Storage
is configured with.
fn get<T>(&mut self, key: &Key<T>) -> Result<Res<T>, StoreErrorOr<T>> where
T: Load,
T::Key: Clone + Hash,
[src]
T: Load,
T::Key: Clone + Hash,
Get a resource from the Storage
and return an error if loading failed.
fn get_proxied<T, P>(
&mut self,
key: &Key<T>,
proxy: P
) -> Result<Res<T>, StoreError> where
T: Load,
T::Key: Clone + Hash,
P: FnOnce() -> T,
[src]
&mut self,
key: &Key<T>,
proxy: P
) -> Result<Res<T>, StoreError> where
T: Load,
T::Key: Clone + Hash,
P: FnOnce() -> T,
Get a resource from the Storage
for the given key. If it fails, a proxied version is used,
which will get replaced by the resource once it’s available and reloaded.