Trait concurrency_traits::AsyncMutex [−][src]
pub trait AsyncMutex<'a>: TryMutex<'a> { type AsyncGuard: DerefMut<Target = Self::Item>; type LockFuture: Future<Output = Self::AsyncGuard>; fn lock_async(&'a self) -> Self::LockFuture; }
A generic async mutex trait
Implementation
It is recommended to implement AsyncMutexSized
if the implement-ee can
be sized.
Associated Types
type AsyncGuard: DerefMut<Target = Self::Item>
[src]
The guard for this async mutex
type LockFuture: Future<Output = Self::AsyncGuard>
[src]
The future that the AsyncMutex::lock_async
function returns
Required methods
fn lock_async(&'a self) -> Self::LockFuture
[src]
Locks the mutex asynchronously, returning a future with the guard.
Implementations on Foreign Types
impl<'__a, 'a, T: ?Sized> AsyncMutex<'__a> for &'a T where
T: AsyncMutex<'__a>,
[src]
impl<'__a, 'a, T: ?Sized> AsyncMutex<'__a> for &'a T where
T: AsyncMutex<'__a>,
[src]type AsyncGuard = T::AsyncGuard
type LockFuture = T::LockFuture
fn lock_async(&'__a self) -> Self::LockFuture
[src]
impl<'__a, 'a, T: ?Sized> AsyncMutex<'__a> for &'a mut T where
T: AsyncMutex<'__a>,
[src]
impl<'__a, 'a, T: ?Sized> AsyncMutex<'__a> for &'a mut T where
T: AsyncMutex<'__a>,
[src]type AsyncGuard = T::AsyncGuard
type LockFuture = T::LockFuture
fn lock_async(&'__a self) -> Self::LockFuture
[src]
impl<'__a, T: ?Sized> AsyncMutex<'__a> for ManuallyDrop<T> where
T: AsyncMutex<'__a>,
[src]
impl<'__a, T: ?Sized> AsyncMutex<'__a> for ManuallyDrop<T> where
T: AsyncMutex<'__a>,
[src]type AsyncGuard = T::AsyncGuard
type LockFuture = T::LockFuture
fn lock_async(&'__a self) -> Self::LockFuture
[src]
impl<'__a, T> AsyncMutex<'__a> for AssertUnwindSafe<T> where
T: AsyncMutex<'__a>,
[src]
impl<'__a, T> AsyncMutex<'__a> for AssertUnwindSafe<T> where
T: AsyncMutex<'__a>,
[src]type AsyncGuard = T::AsyncGuard
type LockFuture = T::LockFuture
fn lock_async(&'__a self) -> Self::LockFuture
[src]
impl<'__a, T: ?Sized> AsyncMutex<'__a> for Rc<T> where
T: AsyncMutex<'__a>,
[src]
impl<'__a, T: ?Sized> AsyncMutex<'__a> for Rc<T> where
T: AsyncMutex<'__a>,
[src]type AsyncGuard = T::AsyncGuard
type LockFuture = T::LockFuture
fn lock_async(&'__a self) -> Self::LockFuture
[src]
impl<'__a, T: ?Sized> AsyncMutex<'__a> for Arc<T> where
T: AsyncMutex<'__a>,
[src]
impl<'__a, T: ?Sized> AsyncMutex<'__a> for Arc<T> where
T: AsyncMutex<'__a>,
[src]type AsyncGuard = T::AsyncGuard
type LockFuture = T::LockFuture
fn lock_async(&'__a self) -> Self::LockFuture
[src]
impl<'__a, T: ?Sized> AsyncMutex<'__a> for Box<T> where
T: AsyncMutex<'__a>,
[src]
impl<'__a, T: ?Sized> AsyncMutex<'__a> for Box<T> where
T: AsyncMutex<'__a>,
[src]type AsyncGuard = T::AsyncGuard
type LockFuture = T::LockFuture
fn lock_async(&'__a self) -> Self::LockFuture
[src]
impl<'__a, 'a, T> AsyncMutex<'__a> for Cow<'a, T> where
T: AsyncMutex<'__a> + Clone,
[src]
impl<'__a, 'a, T> AsyncMutex<'__a> for Cow<'a, T> where
T: AsyncMutex<'__a> + Clone,
[src]type AsyncGuard = T::AsyncGuard
type LockFuture = T::LockFuture
fn lock_async(&'__a self) -> Self::LockFuture
[src]
impl<'a, T> AsyncMutex<'a> for Pin<T> where
T: Deref,
T::Target: AsyncMutex<'a>,
[src]
impl<'a, T> AsyncMutex<'a> for Pin<T> where
T: Deref,
T::Target: AsyncMutex<'a>,
[src]type AsyncGuard = <T::Target as AsyncMutex<'a>>::AsyncGuard
type LockFuture = <T::Target as AsyncMutex<'a>>::LockFuture
fn lock_async(&'a self) -> Self::LockFuture
[src]
Implementors
impl<'a, T, M> AsyncMutex<'a> for CustomMutex<T, M> where
T: 'a,
M: RawAsyncMutex + 'a,
[src]
impl<'a, T, M> AsyncMutex<'a> for CustomMutex<T, M> where
T: 'a,
M: RawAsyncMutex + 'a,
[src]