Skip to main content

AsyncLockLike

Trait AsyncLockLike 

Source
pub trait AsyncLockLike<Lock, Inner>: Send + Sync {
    // Required methods
    fn lock_read<'life0, 'life1, 'async_trait>(
        &'life0 self,
        lock: &'life1 Lock,
    ) -> Pin<Box<dyn Future<Output = Option<Inner>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn lock_write<'life0, 'life1, 'async_trait>(
        &'life0 self,
        lock: &'life1 mut Lock,
    ) -> Pin<Box<dyn Future<Output = Option<Inner>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Async trait for types that can provide async lock/unlock behavior Converts from a Lock type to Inner or InnerMut value asynchronously

Required Methods§

Source

fn lock_read<'life0, 'life1, 'async_trait>( &'life0 self, lock: &'life1 Lock, ) -> Pin<Box<dyn Future<Output = Option<Inner>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get immutable access to the inner value asynchronously

Source

fn lock_write<'life0, 'life1, 'async_trait>( &'life0 self, lock: &'life1 mut Lock, ) -> Pin<Box<dyn Future<Output = Option<Inner>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get mutable access to the inner value asynchronously

Implementors§