Trait concurrency_traits::TryMutex[][src]

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

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

Loading content...

Required methods

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

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

Loading content...

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>

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

type Item = T::Item

type Guard = T::Guard

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

type Item = T::Item

type Guard = T::Guard

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

type Item = T::Item

type Guard = T::Guard

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

type Item = T::Item

type Guard = T::Guard

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

type Item = T::Item

type Guard = T::Guard

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

type Item = T::Item

type Guard = T::Guard

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

type Item = T::Item

type Guard = T::Guard

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

type Item = T::Item

type Guard = T::Guard

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

type Item = <T::Target as TryMutex<'a>>::Item

type Guard = <T::Target as TryMutex<'a>>::Guard

Loading content...

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>

Loading content...