Struct async_ui_internal_utils::wakers_arena::WakersArena
source · pub struct WakersArena { /* private fields */ }
Expand description
An arena to contain many doubly-linked lists of wakers.
Implementations§
source§impl WakersArena
impl WakersArena
sourcepub fn add_sublist(&mut self) -> WakersSublist
pub fn add_sublist(&mut self) -> WakersSublist
Create an empty doubly-linked list of wakers in the arena.
The returned WakersSublist can be used to access this list later.
sourcepub fn add(&mut self, WakersSublist: &WakersSublist) -> WakerSlot
pub fn add(&mut self, WakersSublist: &WakersSublist) -> WakerSlot
Allocate space in a list for a waker.
The allocated slot will have a dummy no-op waker put in. Use update to set your actual waker.
sourcepub fn remove_sublist_if_empty(&mut self, WakersSublist: &WakersSublist) -> bool
pub fn remove_sublist_if_empty(&mut self, WakersSublist: &WakersSublist) -> bool
If the sublist is empty (contains only the head node), remove it and return true.
sourcepub fn update(&mut self, WakerSlot: &WakerSlot, waker: &Waker)
pub fn update(&mut self, WakerSlot: &WakerSlot, waker: &Waker)
Set the waker in the slot.
This method checks Waker::will_wake first.
sourcepub fn iter<'s>(
&'s self,
WakersSublist: &WakersSublist
) -> impl Iterator<Item = &'s Waker> + 's
pub fn iter<'s>( &'s self, WakersSublist: &WakersSublist ) -> impl Iterator<Item = &'s Waker> + 's
Iterate over all the wakers in the given sublist.
Useful for waking the wakers.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for WakersArena
impl Send for WakersArena
impl Sync for WakersArena
impl Unpin for WakersArena
impl UnwindSafe for WakersArena
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