Skip to main content

PollRegistrar

Struct PollRegistrar 

Source
pub struct PollRegistrar<M> { /* private fields */ }
Expand description

Owns every readiness registration made by one polling attempt.

Dropping or resetting a registrar cancels every still-live source lease.

Implementations§

Source§

impl<M> PollRegistrar<M>

Source

pub fn new(waker: &Waker) -> Self

Creates an empty registrar for waker.

Source

pub fn reset(&mut self, waker: &Waker)

Cancels the previous polling attempt and starts one with waker.

Source

pub fn clear(&mut self)

Cancels every registration owned by this registrar.

Source

pub fn is_empty(&self) -> bool

Returns whether this registrar currently owns no registration.

Source§

impl PollRegistrar<SharedObserver>

Source

pub unsafe fn register(&mut self, source: &dyn PollSource, interests: IoEvents)

Registers this observer in source for interests.

§Safety

Registration is task/deferred-context only.

Source§

impl PollRegistrar<ExclusiveConsumer>

Source

pub fn was_exclusively_notified(&self) -> bool

Returns whether an exclusive source selected this polling attempt.

Consumptive sources use this to transfer still-available readiness to the next exclusive waiter without turning ordinary wakeups into a broadcast.

Source

pub unsafe fn register_exclusive( &mut self, source: &dyn PollSource, interests: IoEvents, )

Registers this consumer as an exclusive waiter.

§Safety

Registration is task/deferred-context only.

Source

pub unsafe fn register_shared( &mut self, source: &dyn PollSource, interests: IoEvents, )

Registers this consumer as a shared observer at a composite boundary.

§Safety

Registration is task/deferred-context only.

Trait Implementations§

Source§

impl ExclusiveRegistrationSink for PollRegistrar<ExclusiveConsumer>

Source§

fn waker(&self) -> &Waker

Returns the waker owned by this registration attempt.
Source§

unsafe fn register_exclusive( &mut self, source: &dyn PollSource, interests: IoEvents, )

Adds an exclusive registration owned by this sink. Read more
Source§

fn as_shared(&mut self) -> &mut dyn SharedRegistrationSink

Borrows this sink’s shared-registration capability.
Source§

impl SharedRegistrationSink for PollRegistrar<SharedObserver>

Source§

fn waker(&self) -> &Waker

Returns the waker owned by this registration attempt.
Source§

unsafe fn register_shared( &mut self, source: &dyn PollSource, interests: IoEvents, )

Adds a shared registration owned by this sink. Read more
Source§

impl SharedRegistrationSink for PollRegistrar<ExclusiveConsumer>

Source§

fn waker(&self) -> &Waker

Returns the waker owned by this registration attempt.
Source§

unsafe fn register_shared( &mut self, source: &dyn PollSource, interests: IoEvents, )

Adds a shared registration owned by this sink. Read more

Auto Trait Implementations§

§

impl<M> !RefUnwindSafe for PollRegistrar<M>

§

impl<M> !Sync for PollRegistrar<M>

§

impl<M> !UnwindSafe for PollRegistrar<M>

§

impl<M> Freeze for PollRegistrar<M>
where PhantomData<fn() -> M>: Freeze,

§

impl<M> Send for PollRegistrar<M>
where PhantomData<fn() -> M>: Send,

§

impl<M> Unpin for PollRegistrar<M>
where PhantomData<fn() -> M>: Unpin,

§

impl<M> UnsafeUnpin for PollRegistrar<M>
where PhantomData<fn() -> M>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.