Expand description
Asynchronous data structures like channels need to track sets of waiting futures. Holding them in a Vec requires allocation. We can do better by storing pending wakers in the futures themselves and linking them into an intrusive doubly-linked list.
This crate provides a no_std, no_alloc, safe Rust interface to the above strategy. The shared data structure holds a WakerList and each pending future holds a WakerSlot, each of which holds room for one Waker.
Structs§
- Extracted
Wakers - List of Wakers extracted from WakerList so that Waker::wake
can be called outside of any mutex protecting the
WakerList
. - Waker
List - List of pending Wakers.
- Waker
Slot - A Future’s waker registration slot. Holds at most one pending Waker, which is stored inline within the slot.