pub trait CacheStore: Send + Sync + 'static {
    type Error: StdError + Sync + Send + 'static;
    type Key: Hash + Eq + Send + Clone + 'static;

    // Required methods
    fn load_entry<'life0, 'life1, 'async_trait, Q>(
        &'life0 self,
        key: &'life1 Q
    ) -> Pin<Box<dyn Future<Output = Option<CachedEntry>> + Send + 'async_trait>>
       where Self::Key: Borrow<Q>,
             Q: Hash + Eq + Sync + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save_entry<'life0, 'async_trait>(
        &'life0 self,
        key: Self::Key,
        data: CachedEntry
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Store cache.

Required Associated Types§

source

type Error: StdError + Sync + Send + 'static

Error type for CacheStore.

source

type Key: Hash + Eq + Send + Clone + 'static

Key

Required Methods§

source

fn load_entry<'life0, 'life1, 'async_trait, Q>( &'life0 self, key: &'life1 Q ) -> Pin<Box<dyn Future<Output = Option<CachedEntry>> + Send + 'async_trait>>where Self::Key: Borrow<Q>, Q: Hash + Eq + Sync + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the cache item from the store.

source

fn save_entry<'life0, 'async_trait>( &'life0 self, key: Self::Key, data: CachedEntry ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Save the cache item from the store.

Implementors§

source§

impl<K> CacheStore for MemoryStore<K>where K: Hash + Eq + Send + Sync + Clone + 'static,

Available on crate feature memory-store only.
§

type Error = Infallible

§

type Key = K