Skip to main content

DispatchItem

Enum DispatchItem 

Source
pub enum DispatchItem<U: Encoder + Decoder> {
    Item(<U as Decoder>::Item),
    Control(Control),
    Stop(Reason<U>),
}
Expand description

Event delivered to the dispatcher service.

The codec’s [Decoder::Item] is the request payload, while its [Encoder::Item] is the response payload; these types need not match. Every variant is passed through the same pipeline and may produce a response, no response, or a service error.

Event calls can overlap. In particular, receiving Self::Stop does not mean earlier item calls have finished. See Dispatcher for readiness, response ordering, and shutdown behavior.

Variants§

§

Item(<U as Decoder>::Item)

A frame decoded from the transport.

Produced only when [Decoder::decode] returns Some(item). The decoder determines frame boundaries; a transport read need not correspond to one service call.

§

Control(Control)

A transport flow-control notification.

These describe write-buffer pressure, not an incoming protocol frame.

§

Stop(Reason<U>)

The dispatcher is stopping for the specified reason.

The dispatcher attempts to deliver this through the pipeline before shutting down the service. Delivery waits for service readiness and may be handed to a background task if that wait exceeds the shutdown timeout. A readiness error can prevent the service from receiving it.

Trait Implementations§

Source§

impl<U> Debug for DispatchItem<U>
where U: Encoder + Decoder, <U as Decoder>::Item: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<U> !RefUnwindSafe for DispatchItem<U>

§

impl<U> !UnwindSafe for DispatchItem<U>

§

impl<U> Freeze for DispatchItem<U>
where <U as Decoder>::Item: Freeze, <U as Encoder>::Error: Freeze, <U as Decoder>::Error: Freeze,

§

impl<U> Send for DispatchItem<U>
where <U as Decoder>::Item: Send, <U as Encoder>::Error: Send, <U as Decoder>::Error: Send,

§

impl<U> Sync for DispatchItem<U>
where <U as Decoder>::Item: Sync, <U as Encoder>::Error: Sync, <U as Decoder>::Error: Sync,

§

impl<U> Unpin for DispatchItem<U>
where <U as Decoder>::Item: Unpin, <U as Encoder>::Error: Unpin, <U as Decoder>::Error: Unpin,

§

impl<U> UnsafeUnpin for DispatchItem<U>
where <U as Decoder>::Item: UnsafeUnpin, <U as Encoder>::Error: UnsafeUnpin, <U as Decoder>::Error: 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
§

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

§

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.

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V