[−][src]Struct try_mutex::TryMutex
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
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,