pub(crate) struct Waker {
selectors: Vec<Entry>,
observers: Vec<Entry>,
}
Expand description
A queue of threads blocked on channel operations.
This data structure is used by threads to register blocking operations and get woken up once an operation becomes ready.
Fields§
§selectors: Vec<Entry>
A list of select operations.
observers: Vec<Entry>
A list of operations waiting to be ready.
Implementations§
source§impl Waker
impl Waker
sourcepub(crate) fn register_with_packet(
&mut self,
oper: Operation,
packet: *mut (),
cx: &Context
)
pub(crate) fn register_with_packet( &mut self, oper: Operation, packet: *mut (), cx: &Context )
Registers a select operation and a packet.
sourcepub(crate) fn unregister(&mut self, oper: Operation) -> Option<Entry>
pub(crate) fn unregister(&mut self, oper: Operation) -> Option<Entry>
Unregisters a select operation.
sourcepub(crate) fn try_select(&mut self) -> Option<Entry>
pub(crate) fn try_select(&mut self) -> Option<Entry>
Attempts to find another thread’s entry, select the operation, and wake it up.
sourcepub(crate) fn disconnect(&mut self)
pub(crate) fn disconnect(&mut self)
Notifies all registered operations that the channel is disconnected.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Waker
impl !Send for Waker
impl !Sync for Waker
impl Unpin for Waker
impl UnwindSafe for Waker
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