Struct async_ach_waker::pool::WakerPool
source · [−]pub struct WakerPool<T, const N: usize> { /* private fields */ }
Implementations
sourceimpl<T, const N: usize> WakerPool<T, N>
impl<T, const N: usize> WakerPool<T, N>
pub const fn new() -> Self
sourcepub fn register(&self) -> Result<WakerToken<'_, T, N>, ()>
pub fn register(&self) -> Result<WakerToken<'_, T, N>, ()>
Hold a place in the pool
sourcepub fn wake_one(&self) -> bool
pub fn wake_one(&self) -> bool
Wake a waiter, and remove it.
Returns false if the pool 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, const N: usize> !RefUnwindSafe for WakerPool<T, N>
impl<T, const N: usize> Send for WakerPool<T, N> where
T: Send,
impl<T, const N: usize> Sync for WakerPool<T, N> where
T: Sync,
impl<T, const N: usize> Unpin for WakerPool<T, N> where
T: Unpin,
impl<T, const N: usize> UnwindSafe for WakerPool<T, N> where
T: UnwindSafe,
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