pub struct Store<C, K> { /* private fields */ }
Expand description
Resource store. Responsible for holding and presenting resources.
Implementations
Methods from Deref<Target = Storage<C, K>>
sourcepub fn get<T>(
&mut self,
key: &K,
ctx: &mut C
) -> Result<Res<T>, StoreErrorOr<T, C, K, ()>> where
T: Load<C, K, ()>,
pub fn get<T>(
&mut self,
key: &K,
ctx: &mut C
) -> Result<Res<T>, StoreErrorOr<T, C, K, ()>> where
T: Load<C, K, ()>,
Get a resource from the Storage
and return an error if its loading failed.
This function uses the default loading method.
sourcepub 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>,
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>,
Get a resource from the Storage
by using a specific method and return and error if its
loading failed.
sourcepub fn get_proxied<T, P>(
&mut self,
key: &K,
proxy: P,
ctx: &mut C
) -> Result<Res<T>, StoreError<K>> where
T: Load<C, K, ()>,
P: FnOnce() -> T,
pub fn get_proxied<T, P>(
&mut self,
key: &K,
proxy: P,
ctx: &mut C
) -> Result<Res<T>, StoreError<K>> where
T: Load<C, K, ()>,
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.
This function uses the default loading method.
sourcepub 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,
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,
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.
Trait Implementations
Auto Trait Implementations
impl<C, K> !RefUnwindSafe for Store<C, K>
impl<C, K> !Send for Store<C, K>
impl<C, K> !Sync for Store<C, K>
impl<C, K> Unpin for Store<C, K> where
K: Unpin,
impl<C, K> !UnwindSafe for Store<C, K>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
sourcefn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.