pub trait CacheBackend<K, V>: Send + Sync{
// Required methods
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 K,
) -> Pin<Box<dyn Future<Output = Option<V>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn set<'life0, 'async_trait>(
&'life0 self,
key: K,
value: V,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Pluggable cache backend.
Implementations decide eviction, TTL, and persistence. The default
MemoryCache is unbounded and lives only as long as the process.