Trait concurrency_traits::AsyncTimeoutMutex[][src]

pub trait AsyncTimeoutMutex<'a>: AsyncMutex<'a> {
    type LockTimeoutFuture: Future<Output = Option<Self::AsyncGuard>>;
    fn lock_timeout_async(
        &'a self,
        timeout: Duration
    ) -> Self::LockTimeoutFuture; }

An async mutex that locking can timeout on.

Implementation

It is recommended to implement AsyncTimeoutMutexSized if the implement-ee can be sized.

Associated Types

type LockTimeoutFuture: Future<Output = Option<Self::AsyncGuard>>[src]

The future returned by lock_timeout_async

Loading content...

Required methods

fn lock_timeout_async(&'a self, timeout: Duration) -> Self::LockTimeoutFuture[src]

Locks the mutex asynchronously with a timeout.

Loading content...

Implementations on Foreign Types

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

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

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

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

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

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

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

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

impl<'a, T> AsyncTimeoutMutex<'a> for Pin<T> where
    T: Deref,
    T::Target: AsyncTimeoutMutex<'a>, 
[src]

Loading content...

Implementors

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

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

Loading content...