Struct try_mutex::TryMutex
[−]
[src]
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.
Methods
impl<T> TryMutex<T>
[src]
pub fn new(t: T) -> TryMutex<T>
[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]
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: Default> Default for TryMutex<T>
[src]
impl<T: Debug> Debug for TryMutex<T>
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more