pub struct CacheDriver<K, V, L>where
K: Clone + Eq + Hash + Ord + Debug + Send + 'static,
V: Clone + Debug + Send + 'static,
L: CacheLoader<K = K, V = V>,{ /* private fields */ }Expand description
Combine a CacheBackend and a [Loader] into a single [Cache]
Implementations§
Trait Implementations§
Source§impl<K, V, L> Debug for CacheDriver<K, V, L>
impl<K, V, L> Debug for CacheDriver<K, V, L>
Source§impl<K, V, L> Drop for CacheDriver<K, V, L>
impl<K, V, L> Drop for CacheDriver<K, V, L>
Source§impl<K, V, L> LoadingCache for CacheDriver<K, V, L>
impl<K, V, L> LoadingCache for CacheDriver<K, V, L>
Source§type GetExtra = <L as CacheLoader>::Extra
type GetExtra = <L as CacheLoader>::Extra
Extra data that is provided during
GET but that is NOT part of the cache key.Source§fn get_with_status<'life0, 'async_trait>(
&'life0 self,
k: Self::K,
extra: Self::GetExtra,
) -> Pin<Box<dyn Future<Output = (Self::V, CacheGetStatus)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_with_status<'life0, 'async_trait>(
&'life0 self,
k: Self::K,
extra: Self::GetExtra,
) -> Pin<Box<dyn Future<Output = (Self::V, CacheGetStatus)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn put<'life0, 'async_trait>(
&'life0 self,
k: Self::K,
v: Self::V,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
k: Self::K,
v: Self::V,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Side-load an entry into the cache. If the cache previously contained a value associated with key,
the old value is replaced by value. Read more
Source§fn invalidate(&self, k: Self::K)
fn invalidate(&self, k: Self::K)
Discard any cached value for the key. Read more
Auto Trait Implementations§
impl<K, V, L> Freeze for CacheDriver<K, V, L>
impl<K, V, L> !RefUnwindSafe for CacheDriver<K, V, L>
impl<K, V, L> Send for CacheDriver<K, V, L>
impl<K, V, L> Sync for CacheDriver<K, V, L>
impl<K, V, L> Unpin for CacheDriver<K, V, L>
impl<K, V, L> !UnwindSafe for CacheDriver<K, V, L>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more