Skip to main content

LockExt

Trait LockExt 

Source
pub trait LockExt {
    type Guard<'a>
       where Self: 'a;

    // Required method
    fn lock_or_poisoned(&self) -> Self::Guard<'_>;
}
Expand description

Extension methods for mutexes that should panic when poisoned.

Required Associated Types§

Source

type Guard<'a> where Self: 'a

Guard returned by LockExt::lock_or_poisoned.

Required Methods§

Source

fn lock_or_poisoned(&self) -> Self::Guard<'_>

Lock the mutex, preserving the existing panic-on-poison behavior.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: ?Sized> LockExt for Mutex<T>

Source§

type Guard<'a> = MutexGuard<'a, T> where Self: 'a

Source§

fn lock_or_poisoned(&self) -> Self::Guard<'_>

Implementors§