Trait MutexMethod

Source
pub trait MutexMethod<'a, V> {
    // Required method
    fn lock(&self, mutex: &'a Mutex<V>) -> Option<MutexGuard<'a, V>>;
}
Expand description

Trait for implementing read/write flavors on Mutex. Note that there are no Recursive locks in Mutex, use ReentrantMutex for that.

Required Methods§

Source

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.

Implementors§

Source§

impl<'a, V> MutexMethod<'a, V> for Blocking

Source§

impl<'a, V> MutexMethod<'a, V> for Duration

Source§

impl<'a, V> MutexMethod<'a, V> for Instant

Source§

impl<'a, V> MutexMethod<'a, V> for TryLock