Skip to main content

Module decoder

Module decoder 

Source
Expand description

Request-decoder seam: RequestDecoder + Decoded<E>. Lets the server runtime turn wire frames into application events without naming the concrete wire enum. See decoder for the trait shape and the four outcomes the runtime branches on. Wire-side request decoder seam.

The server runtime (accept loop, frame reader, DPDK transport) consumes incoming frames from the network and needs to turn them into application events to publish to the pipeline. The decoding itself — pattern-matching on the wire enum, mapping per-variant fields, enforcing per-connection permission policy — is application-shaped: a trading server decodes order submissions, a payments server decodes transfers, a logistics server decodes shipment events. This trait is the seam that lets the runtime delegate that decoding to the application without ever naming the concrete wire enum.

The runtime calls [RequestDecoder::decode] once per incoming frame; the [Decoded] return value encodes exactly the four outcomes the runtime acts on (drop, publish, reject with reason, log decode error).

Enums§

Decoded
Outcome of a single RequestDecoder::decode call. The runtime branches on this and never needs to know the underlying wire enum.

Traits§

RequestDecoder
Decode an authenticated client frame into an application event the runtime can publish to the pipeline.