Expand description
Implements a combined mutex and condition.
§Example:
let condition = Condition::new(0);
condition.when(|state| if state == 1 { Poll::Ready(()) } else { Poll::Pending }).await;
// Elsewhere...
let guard = condition.lock();
*guard.lock() = 1;
for waker in guard.drain_wakers() {
waker.wake();
}
Structs§
- An async condition which combines a mutex and a condition variable.
- Guard returned by
lock
. - An iterator that will drain waiters.
- A waker entry that can be added to a list.