Skip to main content

Module middleware

Module middleware 

Source
Expand description

Stateful, composable interception of owned protocol messages.

Middleware receives ownership of a decoded message and a mutable reference to caller-defined state. Returning the input unchanged is a no-op; implementations may instead mutate it or return another message of the same type. Protocol session APIs remain responsible for checking that the result is legal in their current state before advancing.

Structs§

AsynchronousBackendMessage
Validated backend traffic which does not advance the current protocol phase.
Identity
Middleware which returns every message unchanged.
Middleware
Owns user state and middleware as one reusable interception unit.
Then
Two middleware stages evaluated from first to second.
WireAdapter
Adapts one direction-wide wire middleware to every generated typed phase.

Enums§

ChainError
Identifies which stage of a two-part middleware chain failed.
ClientRole
Marker for middleware handling messages sent by a PostgreSQL client.
InterceptError
Failure while applying or validating middleware output.
ReceiveError
I/O or interception failure while receiving a middleware-checked message.
ServerRole
Marker for middleware handling messages sent by a PostgreSQL server.
TypedBackendMessage
Any server message legal in a phase, including non-advancing asynchronous traffic.
TypedReceiveError
Failure while receiving through compile-time phase-checked middleware.
WireAdapterError
Failure from direction-wide middleware adapted to a typed phase.

Traits§

AcceptsMessage
State-aware validation of one directional protocol message type.
MessageMiddleware
Intercepts an owned message with access to caller-defined state.
MessageMiddlewareExt
Adds composition to every sized middleware implementation.
ReconstructableMessage
A protocol message which can verify that it has a valid wire representation.
TypedMiddleware
Middleware whose role, protocol phase, and legal message set are type indexed.
TypedPhase
Associates a connection typestate with its generated legal message type.