Struct parking_method::TryLock
source · [−]pub struct TryLock;
Expand description
Marker for trying to obtain a lock in a fallible way.
Trait Implementations
sourceimpl<'a, V> MutexMethod<'a, V> for TryLock
impl<'a, V> MutexMethod<'a, V> for TryLock
sourcefn lock(&self, mutex: &'a Mutex<V>) -> Option<MutexGuard<'a, V>>
fn lock(&self, mutex: &'a Mutex<V>) -> Option<MutexGuard<'a, V>>
Obtain a lock on a mutex. Blocking locks are infallible and always return a ‘Some()’ variant.
sourceimpl ReadLockMethod for TryLock
impl ReadLockMethod for TryLock
sourcefn read<'a, V>(&self, rwlock: &'a RwLock<V>) -> Option<RwLockReadGuard<'a, V>>
fn read<'a, V>(&self, rwlock: &'a RwLock<V>) -> Option<RwLockReadGuard<'a, V>>
Obtain a read lock. Blocking locks are infallible and always return a ‘Some()’ variant.
sourceimpl<'a, V> ReentrantMutexMethod<'a, V> for TryLock
impl<'a, V> ReentrantMutexMethod<'a, V> for TryLock
sourcefn lock(
&self,
mutex: &'a ReentrantMutex<V>
) -> Option<ReentrantMutexGuard<'a, V>>
fn lock(
&self,
mutex: &'a ReentrantMutex<V>
) -> Option<ReentrantMutexGuard<'a, V>>
Obtain a lock on a reentrant mutex. Blocking locks are infallible and always return a ‘Some()’ variant. Read more
sourceimpl WriteLockMethod for TryLock
impl WriteLockMethod for TryLock
sourcefn write<'a, V>(&self, rwlock: &'a RwLock<V>) -> Option<RwLockWriteGuard<'a, V>>
fn write<'a, V>(&self, rwlock: &'a RwLock<V>) -> Option<RwLockWriteGuard<'a, V>>
Obtain a write lock. Blocking locks are infallible and always return a ‘Some()’ variant.
Auto Trait Implementations
impl RefUnwindSafe for TryLock
impl Send for TryLock
impl Sync for TryLock
impl Unpin for TryLock
impl UnwindSafe for TryLock
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more