pub trait IOCachedAsync<K, V> {
    type Error;
    fn cache_get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        k: &'life1 K
    ) -> Pin<Box<dyn Future<Output = Result<Option<V>, Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn cache_set<'life0, 'async_trait>(
        &'life0 self,
        k: K,
        v: V
    ) -> Pin<Box<dyn Future<Output = Result<Option<V>, Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn cache_remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        k: &'life1 K
    ) -> Pin<Box<dyn Future<Output = Result<Option<V>, Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn cache_set_refresh(&mut self, refresh: bool) -> bool; fn cache_lifespan(&self) -> Option<u64> { ... }
fn cache_set_lifespan(&mut self, _seconds: u64) -> Option<u64> { ... } }

Associated Types

Required methods

Remove a cached value

Set the flag to control whether cache hits refresh the ttl of cached values, returns the old flag value

Provided methods

Return the lifespan of cached values (time to eviction)

Set the lifespan of cached values, returns the old value

Implementors