Skip to main content

PollCtx

Struct PollCtx 

Source
pub struct PollCtx<'a, InEvent, OutEvent> { /* private fields */ }
Expand description

A service context mailbox handle for the Service::poll method.

Implementations§

Source§

impl<'a, InEvent, OutEvent> PollCtx<'a, InEvent, OutEvent>

Source

pub fn split(self) -> (InCtx<'a, InEvent>, OutCtx<'a, OutEvent>)

Split this context into its input and output mailbox context handles.

Source

pub fn len(&self) -> usize

Get the number of events in the input mailbox.

Source

pub fn is_empty(&self) -> bool

Check if the input mailbox is empty.

Source

pub fn pop_next(&mut self) -> Option<InEvent>

Pop the next event from the input mailbox.

Source

pub fn emit(&mut self, ev: OutEvent)

Emit an event to the output mailbox.

Source

pub fn emit_batch(&mut self, evs: impl IntoIterator<Item = OutEvent>)

Emit a batch of events to the output mailbox.

Auto Trait Implementations§

§

impl<'a, InEvent, OutEvent> !UnwindSafe for PollCtx<'a, InEvent, OutEvent>

§

impl<'a, InEvent, OutEvent> Freeze for PollCtx<'a, InEvent, OutEvent>
where InCtx<'a, InEvent>: Freeze, OutCtx<'a, OutEvent>: Freeze,

§

impl<'a, InEvent, OutEvent> RefUnwindSafe for PollCtx<'a, InEvent, OutEvent>
where InCtx<'a, InEvent>: RefUnwindSafe, OutCtx<'a, OutEvent>: RefUnwindSafe,

§

impl<'a, InEvent, OutEvent> Send for PollCtx<'a, InEvent, OutEvent>
where InCtx<'a, InEvent>: Send, OutCtx<'a, OutEvent>: Send,

§

impl<'a, InEvent, OutEvent> Sync for PollCtx<'a, InEvent, OutEvent>
where InCtx<'a, InEvent>: Sync, OutCtx<'a, OutEvent>: Sync,

§

impl<'a, InEvent, OutEvent> Unpin for PollCtx<'a, InEvent, OutEvent>
where InCtx<'a, InEvent>: Unpin, OutCtx<'a, OutEvent>: Unpin,

§

impl<'a, InEvent, OutEvent> UnsafeUnpin for PollCtx<'a, InEvent, OutEvent>
where InCtx<'a, InEvent>: UnsafeUnpin, OutCtx<'a, OutEvent>: 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.