HandyRwLock

Trait HandyRwLock 

Source
pub trait HandyRwLock<T: ?Sized> {
    // Required methods
    fn wl(&self) -> RwLockWriteGuard<'_, T>;
    fn rl(&self) -> RwLockReadGuard<'_, T>;
}
Expand description

copy from https://github.com/tikv/tikv/blob/b15ea3b1cd766375cb52019e35c195ed797124df/components/tikv_util/src/lib.rs#L171-L186

A handy shortcut to replace RwLock write/read().unwrap() pattern to shortcut wl and rl.

Required Methods§

Source

fn wl(&self) -> RwLockWriteGuard<'_, T>

Source

fn rl(&self) -> RwLockReadGuard<'_, T>

Implementations on Foreign Types§

Source§

impl<T: ?Sized> HandyRwLock<T> for RwLock<T>

Source§

fn wl(&self) -> RwLockWriteGuard<'_, T>

Source§

fn rl(&self) -> RwLockReadGuard<'_, T>

Implementors§