pub struct Storage<C, K> { /* fields omitted */ }
Resource storage.
This type is responsible for storing resources, giving functions to look them up and update
them whenever needed.
The canonicalized root the Storage
is configured with.
Get a resource from the Storage
and return an error if its loading failed.
This function uses the default loading method.
pub fn get_by<T, M>( &mut self, key: &K, ctx: &mut C, _: M ) -> Result<Res<T>, StoreErrorOr<T, C, K, M>> where T: Load<C, K, M>, | [src] |
Get a resource from the Storage
by using a specific method and return and error if its
loading failed.
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.
This function uses the default loading method.
pub fn get_proxied_by<T, M, P>( &mut self, key: &K, proxy: P, ctx: &mut C, method: M ) -> Result<Res<T>, StoreError<K>> where T: Load<C, K, M>, P: FnOnce() -> T, | [src] |
Get a resource from the Storage
for the given key by using a specific method. If it fails, a
proxied version is used, which will get replaced by the resource once it’s available and
reloaded.
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static