Trait concurrency_traits::mutex::TryMutex[][src]

pub trait TryMutex<'a> {
    type Item: ?Sized;
    type Guard: DerefMut<Target = Self::Item>;
    fn try_lock(&'a self) -> Option<Self::Guard>;
}
Expand description

A non-blocking mutex with try functions.

Implementation

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

Associated Types

type Item: ?Sized[src]

The item stored in the mutex

type Guard: DerefMut<Target = Self::Item>[src]

The guard for the mutex

Required methods

fn try_lock(&'a self) -> Option<Self::Guard>[src]

Tries to lock the mutex, returning None if not possible.

Implementations on Foreign Types

impl<'a, T: ?Sized> TryMutex<'a> for Mutex<T> where
    T: 'a, 
[src]

type Item = T

type Guard = MutexGuard<'a, T>

fn try_lock(&'a self) -> Option<Self::Guard>[src]

Implementors

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

type Item = T

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

fn try_lock(&'a self) -> Option<Self::Guard>[src]