pub trait TypedMiddleware<Role, Phase, Message, State> {
type Error;
// Required method
fn intercept_typed(
&mut self,
state: &mut State,
message: Message,
) -> Result<Message, Self::Error>;
}Expand description
Middleware whose role, protocol phase, and legal message set are type indexed.
Message should be a phase-specific message type generated by
pg_proto_fsm::protocol. Such values can only be obtained after a decoded
wire message has been projected into a legal transition for Phase, so an
implementation cannot return a replacement from another role or phase.
Required Associated Types§
Required Methods§
Sourcefn intercept_typed(
&mut self,
state: &mut State,
message: Message,
) -> Result<Message, Self::Error>
fn intercept_typed( &mut self, state: &mut State, message: Message, ) -> Result<Message, Self::Error>
Observes, mutates, or replaces one phase-legal message.
§Errors
Returns a policy-defined error to stop message processing.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".