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.