pub struct WakerPool<T, const N: usize> { /* private fields */ }Implementations§
Source§impl<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> !Freeze for WakerPool<T, N>
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> UnsafeUnpin for WakerPool<T, N>where
T: UnsafeUnpin,
impl<T, const N: usize> UnwindSafe for WakerPool<T, N>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more