pub type MokaCacheImplementation<CacheKeyT = CommonCacheKey> = Arc<Cache<CacheKeyT, CachedResponseRef>>;Available on crate feature
moka only.Expand description
Moka cache implementation.
Note that it is based on the sync version of Moka cache rather than its future version.
The reason is that our get is not async, and unfortunately the future version of Moka
does not have a non-async version of its get.
Aliased Type§
pub struct MokaCacheImplementation<CacheKeyT = CommonCacheKey> { /* private fields */ }Trait Implementations§
Source§impl<CacheKeyT> Cache<CacheKeyT> for MokaCacheImplementation<CacheKeyT>where
CacheKeyT: CacheKey,
impl<CacheKeyT> Cache<CacheKeyT> for MokaCacheImplementation<CacheKeyT>where
CacheKeyT: CacheKey,
Source§async fn get(&self, key: &CacheKeyT) -> Option<CachedResponseRef>
async fn get(&self, key: &CacheKeyT) -> Option<CachedResponseRef>
Get an entry from the cache. Read more
Source§async fn put(&self, key: CacheKeyT, cached_response: CachedResponseRef)
async fn put(&self, key: CacheKeyT, cached_response: CachedResponseRef)
Put an entry in the cache. Read more
Source§async fn invalidate(&self, key: &CacheKeyT)
async fn invalidate(&self, key: &CacheKeyT)
Invalidate a cache entry. Read more
Source§async fn invalidate_all(&self)
async fn invalidate_all(&self)
Invalidate all cache entries. Read more