Guard

Trait Guard 

Source
pub trait Guard<T>: Send + Sync {
    type D: for<'a> DerefLt<'a, T>;

    // Required methods
    fn store<'life0, 'async_trait>(
        &'life0 mut self,
        data: T,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load<'s, 'async_trait>(
        &'s self,
    ) -> Pin<Box<dyn Future<Output = Result<<Self::D as DerefLt<'s, T>>::Deref>> + Send + 'async_trait>>
       where Self: 'async_trait,
             's: 'async_trait;
    fn clear<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Associated Types§

Source

type D: for<'a> DerefLt<'a, T>

Required Methods§

Source

fn store<'life0, 'async_trait>( &'life0 mut self, data: T, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn load<'s, 'async_trait>( &'s self, ) -> Pin<Box<dyn Future<Output = Result<<Self::D as DerefLt<'s, T>>::Deref>> + Send + 'async_trait>>
where Self: 'async_trait, 's: 'async_trait,

Source

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

Implementors§

Source§

impl<'a, T> Guard<T> for LocalGuard<'a, T>
where T: Send + Sync + 'static,

Source§

impl<'a, T> Guard<T> for RedisGuard<'a, T>
where T: FromRedisValue + ToRedisArgs + Send + Sync + 'static,