AsyncLockableMediator

Trait AsyncLockableMediator 

Source
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§

Source

fn wait_lockable(&mut self, cx: &mut Context<'_>) -> usize

Block the current task and wait for lockable event.

Return the unique wait key.

Source

fn cancel(&mut self, key: usize) -> bool

Cancel the waker by key value. Returns true if remove waker successfully.

Source

fn notify_one(&mut self)

Randomly notify one listener that it can try to lock this mutex again.

Source

fn notify_all(&mut self)

notify all listeners that they can try to lock this mutex again.

Implementors§