Struct async_ach_waker::list::WakerList
source · [−]pub struct WakerList<T> { /* private fields */ }
Implementations
sourceimpl<T> WakerList<T>
impl<T> WakerList<T>
pub const fn new() -> Self
sourcepub unsafe fn register(&self, waker: &mut Node<WakerEntity<T>>)
pub unsafe fn register(&self, waker: &mut Node<WakerEntity<T>>)
Register a waker
Safety:
This function is only safe as long as node
is guaranteed to
get removed from the list before it gets moved or dropped.
sourcepub fn remove(&self, waker: &mut Node<WakerEntity<T>>)
pub fn remove(&self, waker: &mut Node<WakerEntity<T>>)
Removes a node from the LinkedList.
sourcepub fn wake_one(&self) -> bool
pub fn wake_one(&self) -> bool
Wake a waiter, and remove it.
Returns false if the list is empty.
sourcepub fn wake_all(&self) -> usize
pub fn wake_all(&self) -> usize
Wake all waiter, and remove it.
returns the number of had waked
sourcepub fn retain(&self, f: impl FnMut(&WakerEntity<T>) -> bool)
pub fn retain(&self, f: impl FnMut(&WakerEntity<T>) -> bool)
Retains only the elements specified by the predicate.
In other words, remove all elements e such that f(&e) returns false. This method operates in place, visiting each element exactly once in the original order, but not preserves the order of the retained elements.
Auto Trait Implementations
impl<T> RefUnwindSafe for WakerList<T>
impl<T> Send for WakerList<T>
impl<T> Sync for WakerList<T>
impl<T> Unpin for WakerList<T>
impl<T> !UnwindSafe for WakerList<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more