MutexProvider

Trait MutexProvider 

Source
pub trait MutexProvider<T, K>: Send + Sync {
    type Mutex: Send + Mutex<T>;

    // Required method
    fn get<'life0, 'async_trait>(
        &'life0 self,
        key: K,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Mutex>> + Send + 'async_trait>>
       where K: 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
}

Required Associated Types§

Required Methods§

Source

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

Implementations on Foreign Types§

Source§

impl<'a, T, K, U: 'a + MutexProvider<T, K> + ?Sized> MutexProvider<T, K> for &'a U
where &'a U: Send + Sync,

Source§

type Mutex = <U as MutexProvider<T, K>>::Mutex

Source§

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

Source§

impl<'a, T, K, U: 'a + MutexProvider<T, K> + ?Sized> MutexProvider<T, K> for &'a mut U
where &'a mut U: Send + Sync,

Source§

type Mutex = <U as MutexProvider<T, K>>::Mutex

Source§

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

Source§

impl<T, K, U: MutexProvider<T, K> + ?Sized> MutexProvider<T, K> for Box<U>
where Box<U>: Send + Sync,

Source§

type Mutex = <U as MutexProvider<T, K>>::Mutex

Source§

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

Source§

impl<T, K, U: MutexProvider<T, K> + ?Sized> MutexProvider<T, K> for Arc<U>
where Arc<U>: Send + Sync,

Source§

type Mutex = <U as MutexProvider<T, K>>::Mutex

Source§

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

Implementors§

Source§

impl<T, K> MutexProvider<T, K> for LocalMutexProvider<T, K>
where T: Send + Sync + 'static, K: Hash + Eq + Send + Sync,

Source§

impl<T, K> MutexProvider<T, K> for RedisMutexProvider
where T: FromRedisValue + ToRedisArgs + Send + Sync + 'static, K: AsRef<str> + Send,