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

Loading content...

Required methods

fn lock_async(&'a self) -> Self::LockFuture[src]

Locks the mutex asynchronously, returning a future with the guard.

Loading content...

Implementations on Foreign Types

impl<'__a, 'a, T: ?Sized> AsyncMutex<'__a> for &'a T where
    T: AsyncMutex<'__a>, 
[src]

type AsyncGuard = T::AsyncGuard

type LockFuture = T::LockFuture

impl<'__a, 'a, T: ?Sized> AsyncMutex<'__a> for &'a mut T where
    T: AsyncMutex<'__a>, 
[src]

type AsyncGuard = T::AsyncGuard

type LockFuture = T::LockFuture

impl<'__a, T: ?Sized> AsyncMutex<'__a> for ManuallyDrop<T> where
    T: AsyncMutex<'__a>, 
[src]

type AsyncGuard = T::AsyncGuard

type LockFuture = T::LockFuture

impl<'__a, T> AsyncMutex<'__a> for AssertUnwindSafe<T> where
    T: AsyncMutex<'__a>, 
[src]

type AsyncGuard = T::AsyncGuard

type LockFuture = T::LockFuture

impl<'__a, T: ?Sized> AsyncMutex<'__a> for Rc<T> where
    T: AsyncMutex<'__a>, 
[src]

type AsyncGuard = T::AsyncGuard

type LockFuture = T::LockFuture

impl<'__a, T: ?Sized> AsyncMutex<'__a> for Arc<T> where
    T: AsyncMutex<'__a>, 
[src]

type AsyncGuard = T::AsyncGuard

type LockFuture = T::LockFuture

impl<'__a, T: ?Sized> AsyncMutex<'__a> for Box<T> where
    T: AsyncMutex<'__a>, 
[src]

type AsyncGuard = T::AsyncGuard

type LockFuture = T::LockFuture

impl<'__a, 'a, T> AsyncMutex<'__a> for Cow<'a, T> where
    T: AsyncMutex<'__a> + Clone
[src]

type AsyncGuard = T::AsyncGuard

type LockFuture = T::LockFuture

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

Loading content...

Implementors

impl<'a, T, M> AsyncMutex<'a> for CustomMutex<T, M> where
    T: 'a,
    M: RawAsyncMutex + 'a, 
[src]

type AsyncGuard = CustomMutexGuard<'a, T, M>

type LockFuture = Pin<Box<dyn Future<Output = Self::AsyncGuard> + 'a>>

Loading content...