Closed
Description
For example, sync::RwLockWriteGuard
implements Deref
and DerefMut
, implements the downgrade
method, and has a public cond
field. Since Rust doesn't have distinct .
and ->
operators, this makes for an API that can be confusing and ambiguous.
Adding an extra layer of indirection seems like a reasonable solution. It feels a bit strange to call methods of the wrapped type on an RAII lock guard anyways:
let locked_foo: RwLock<Foo> = ...;
let mut guard = locked_foo.write();
while !guard.get().is_foo() {
guard.cond.wait();
}
Metadata
Metadata
Assignees
Labels
No labels