pub trait RequestDecoder: Send + Sync {
type Event: AppEvent;
type Role: Role;
// Required method
fn decode(
&self,
body: &[u8],
role: ClientRole<Self::Role>,
) -> Decoded<Self::Event>;
}Expand description
Decode an authenticated client request into an application event the runtime can publish to the pipeline.
Stateless on the connection (the runtime carries connection-level
state — the client’s role, key_hash — and feeds the relevant piece
in per call). Implementors are typically zero-sized types.
Required Associated Types§
Required Methods§
Sourcefn decode(
&self,
body: &[u8],
role: ClientRole<Self::Role>,
) -> Decoded<Self::Event>
fn decode( &self, body: &[u8], role: ClientRole<Self::Role>, ) -> Decoded<Self::Event>
Decode one request. body is the application frame’s body, up to
the end of the frame, and may be empty. role is the role of the
key the connection authenticated with: the runtime’s operator, or
one of the application’s own.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".