Skip to main content

RwLockExt

Trait RwLockExt 

Source
pub trait RwLockExt {
    type ReadGuard<'a>
       where Self: 'a;
    type WriteGuard<'a>
       where Self: 'a;

    // Required methods
    fn read_or_poisoned(&self) -> Self::ReadGuard<'_>;
    fn write_or_poisoned(&self) -> Self::WriteGuard<'_>;
}
Expand description

Extension methods for read-write locks that should panic when poisoned.

Required Associated Types§

Source

type ReadGuard<'a> where Self: 'a

Guard returned by RwLockExt::read_or_poisoned.

Source

type WriteGuard<'a> where Self: 'a

Guard returned by RwLockExt::write_or_poisoned.

Required Methods§

Source

fn read_or_poisoned(&self) -> Self::ReadGuard<'_>

Acquire a read guard, preserving the existing panic-on-poison behavior.

Source

fn write_or_poisoned(&self) -> Self::WriteGuard<'_>

Acquire a write guard, 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> RwLockExt for RwLock<T>

Source§

type ReadGuard<'a> = RwLockReadGuard<'a, T> where Self: 'a

Source§

type WriteGuard<'a> = RwLockWriteGuard<'a, T> where Self: 'a

Source§

fn read_or_poisoned(&self) -> Self::ReadGuard<'_>

Source§

fn write_or_poisoned(&self) -> Self::WriteGuard<'_>

Implementors§