pub struct PollSet(/* private fields */);Expand description
A readiness source containing shared observers and exclusive consumers.
Implementations§
Source§impl PollSet
impl PollSet
Sourcepub unsafe fn wake(&self, ready: IoEvents) -> usize
pub unsafe fn wake(&self, ready: IoEvents) -> usize
Wakes every matching shared observer and one matching exclusive consumer.
§Safety
This method is task/deferred-context only. Readiness must be published first through synchronization observed by the consumer’s readiness check, and the caller must not hold a lock that a waker may re-enter.
Sourcepub unsafe fn wake_with(
&self,
ready: IoEvents,
wake: impl FnMut(Waker),
) -> usize
pub unsafe fn wake_with( &self, ready: IoEvents, wake: impl FnMut(Waker), ) -> usize
Wakes matching registrations through a caller-selected Waker policy.
Every matching shared observer and one matching exclusive consumer is
removed and passed by value to wake. The callback runs after the
readiness-queue lock is released. This permits an OS adapter to attach
scheduler intent such as Linux WF_SYNC without coupling this generic
readiness crate to one task implementation.
§Safety
This method is task/deferred-context only. Readiness must be published first through synchronization observed by the consumer’s readiness check, and the caller must not hold a lock that the callback may re-enter.
Sourcepub unsafe fn wake_all(&self, ready: IoEvents) -> usize
pub unsafe fn wake_all(&self, ready: IoEvents) -> usize
Wakes every matching shared observer and exclusive consumer.
Use this only after publishing a permanent terminal transition.
§Safety
This method is task/deferred-context only. The caller must not hold a lock that a waker may re-enter. The terminal state must be published through synchronization observed by the consumer’s readiness check.
Trait Implementations§
Source§impl PollSource for PollSet
impl PollSource for PollSet
Source§unsafe fn register(
&self,
waker: &Waker,
interests: IoEvents,
mode: RegistrationMode,
) -> Option<Box<dyn PollRegistration>>
unsafe fn register( &self, waker: &Waker, interests: IoEvents, mode: RegistrationMode, ) -> Option<Box<dyn PollRegistration>>
waker and returns the exact cancellation lease. Read more