Struct cache_loader_async::cache_api::LoadingCache [−][src]
pub struct LoadingCache<K, V> { /* fields omitted */ }
Implementations
impl<K: Eq + Hash + Clone + Send + 'static, V: Clone + Sized + Send + 'static> LoadingCache<K, V>
[src]
impl<K: Eq + Hash + Clone + Send + 'static, V: Clone + Sized + Send + 'static> LoadingCache<K, V>
[src]pub fn new<T, F>(loader: T) -> (LoadingCache<K, V>, CacheHandle) where
F: Future<Output = Option<V>> + Sized + Send + 'static,
T: Fn(K) -> F + Send + 'static,
[src]
F: Future<Output = Option<V>> + Sized + Send + 'static,
T: Fn(K) -> F + Send + 'static,
pub async fn get(&self, key: K) -> Result<V, CacheLoadingError>
[src]
pub async fn set(
&self,
key: K,
value: V
) -> Result<Option<V>, CacheLoadingError>
[src]
&self,
key: K,
value: V
) -> Result<Option<V>, CacheLoadingError>
pub async fn update<U>(
&self,
key: K,
update_fn: U
) -> Result<V, CacheLoadingError> where
U: FnOnce(V) -> V + Send + 'static,
[src]
&self,
key: K,
update_fn: U
) -> Result<V, CacheLoadingError> where
U: FnOnce(V) -> V + Send + 'static,
Trait Implementations
impl<K: Clone, V: Clone> Clone for LoadingCache<K, V>
[src]
impl<K: Clone, V: Clone> Clone for LoadingCache<K, V>
[src]fn clone(&self) -> LoadingCache<K, V>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<K, V> !RefUnwindSafe for LoadingCache<K, V>
impl<K, V> !RefUnwindSafe for LoadingCache<K, V>
impl<K, V> Send for LoadingCache<K, V> where
K: Send,
V: Send,
impl<K, V> Send for LoadingCache<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for LoadingCache<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for LoadingCache<K, V> where
K: Send,
V: Send,
impl<K, V> Unpin for LoadingCache<K, V>
impl<K, V> Unpin for LoadingCache<K, V>
impl<K, V> !UnwindSafe for LoadingCache<K, V>
impl<K, V> !UnwindSafe for LoadingCache<K, V>