async-rs / async-std

Async version of the Rust standard library

Home Page:https://async.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add an owned variant of RwLockReadGuard and RwLockWriteGuard

haselkern opened this issue · comments

When locking an Arc<Mutex<...>> I can call lock_arc, which returns an extremely handy owned MutexGuardArc.

I would expect an Arc<RwLock<...>> to provide read_arc and write_arc to return owned guards as well, unfortunately these methods do not exist. They should be possible to implement, since the tokio project does provide such methods.