pub trait AsyncLockableMediator {
// Required methods
fn wait_lockable(&mut self, cx: &mut Context<'_>) -> usize;
fn cancel(&mut self, key: usize) -> bool;
fn notify_one(&mut self);
fn notify_all(&mut self);
}Expand description
Event manager for AsyncLockable listeners.
Required Methods§
Sourcefn wait_lockable(&mut self, cx: &mut Context<'_>) -> usize
fn wait_lockable(&mut self, cx: &mut Context<'_>) -> usize
Block the current task and wait for lockable event.
Return the unique wait key.
Sourcefn cancel(&mut self, key: usize) -> bool
fn cancel(&mut self, key: usize) -> bool
Cancel the waker by key value. Returns true if remove waker successfully.
Sourcefn notify_one(&mut self)
fn notify_one(&mut self)
Randomly notify one listener that it can try to lock this mutex again.
Sourcefn notify_all(&mut self)
fn notify_all(&mut self)
notify all listeners that they can try to lock this mutex again.