[][src]Struct try_mutex::TryMutex

pub struct TryMutex<T> { /* fields omitted */ }

A mutual exclusion primitive that does not support blocking or poisoning. This results in a simpler and faster implementation.

Implementations

impl<T> TryMutex<T>[src]

pub const fn new(t: T) -> Self[src]

Create a new mutex in unlocked state.

pub fn try_lock(&self) -> Option<TryMutexGuard<'_, T>>[src]

Attemps to acquire a lock on this mutex. If this mutex is currently locked, None is returned. Otherwise a RAII guard is returned. The lock will be unlocked when the guard is dropped.

pub fn into_inner(self) -> T[src]

Consumes this mutex, returning the underlying data.

pub fn get_mut(&mut self) -> &mut T[src]

Retrieve a mutable reference to the underlying data. Since this mutably borrows the mutex, no actual locking needs to take place.

Trait Implementations

impl<T: Debug> Debug for TryMutex<T>[src]

impl<T: Default> Default for TryMutex<T>[src]

impl<T> From<T> for TryMutex<T>[src]

impl<T> RefUnwindSafe for TryMutex<T>[src]

impl<T: Send> Send for TryMutex<T>[src]

impl<T: Send> Sync for TryMutex<T>[src]

impl<T> UnwindSafe for TryMutex<T>[src]

Auto Trait Implementations

impl<T> Unpin for TryMutex<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.