Skip to main content

MutexExt

Trait MutexExt 

Source
pub trait MutexExt<T> {
    // Required method
    fn lock_or_recover(&self) -> MutexGuard<'_, T>;
}
Expand description

Extension trait adding poison-recovering locking to Mutex.

Required Methods§

Source

fn lock_or_recover(&self) -> MutexGuard<'_, T>

Locks the mutex, recovering the guard if it is poisoned.

On poison, logs a warning naming the call site and returns the inner guard anyway.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T> MutexExt<T> for Mutex<T>

Implementors§