[][src]Trait casbin::Cache

pub trait Cache<K, V>: Send + Sync where
    K: Eq + Hash
{ fn set_capacity(&mut self, c: usize);
fn set_ttl(&mut self, t: Duration);
#[must_use] fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        k: &'life1 K
    ) -> Pin<Box<dyn Future<Output = Option<&V>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn has<'life0, 'life1, 'async_trait>(
        &'life0 self,
        k: &'life1 K
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn set<'life0, 'async_trait>(
        &'life0 mut self,
        k: K,
        v: V
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn clear<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

Required methods

fn set_capacity(&mut self, c: usize)

fn set_ttl(&mut self, t: Duration)

#[must_use]fn get<'life0, 'life1, 'async_trait>(
    &'life0 self,
    k: &'life1 K
) -> Pin<Box<dyn Future<Output = Option<&V>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn has<'life0, 'life1, 'async_trait>(
    &'life0 self,
    k: &'life1 K
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn set<'life0, 'async_trait>(
    &'life0 mut self,
    k: K,
    v: V
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn clear<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Loading content...

Implementors

Loading content...