pub trait RwLockExt<T> {
// Required methods
fn read_or_recover(&self) -> RwLockReadGuard<'_, T>;
fn write_or_recover(&self) -> RwLockWriteGuard<'_, T>;
}Expand description
Extension trait adding poison-recovering locking to RwLock.
Required Methods§
Sourcefn read_or_recover(&self) -> RwLockReadGuard<'_, T>
fn read_or_recover(&self) -> RwLockReadGuard<'_, T>
Acquires a read guard, recovering it if the lock is poisoned.
On poison, logs a warning naming the call site and returns the inner guard anyway.
Sourcefn write_or_recover(&self) -> RwLockWriteGuard<'_, T>
fn write_or_recover(&self) -> RwLockWriteGuard<'_, T>
Acquires a write guard, recovering it if the lock 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".