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§
Sourcefn 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_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
Sourcefn 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,
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