pub trait IntermediaryMiddleware<State, ServerContext, ClientContext> {
type Error;
// Provided methods
fn frontend<'a>(
&'a mut self,
_server: &'a ServerContext,
_client: &'a ClientContext,
_state: &'a mut State,
message: FrontendMessage,
) -> Pin<Box<dyn Future<Output = Result<FrontendMiddlewareOutput, Self::Error>> + 'a>> { ... }
fn backend<'a>(
&'a mut self,
_server: &'a ServerContext,
_client: &'a ClientContext,
_state: &'a mut State,
message: BackendMessage,
) -> Pin<Box<dyn Future<Output = Result<BackendMiddlewareOutput, Self::Error>> + 'a>> { ... }
}Expand description
Asynchronous, fallible middleware at the forwarding boundary.
Required Associated Types§
Provided Methods§
Sourcefn frontend<'a>(
&'a mut self,
_server: &'a ServerContext,
_client: &'a ClientContext,
_state: &'a mut State,
message: FrontendMessage,
) -> Pin<Box<dyn Future<Output = Result<FrontendMiddlewareOutput, Self::Error>> + 'a>>
fn frontend<'a>( &'a mut self, _server: &'a ServerContext, _client: &'a ClientContext, _state: &'a mut State, message: FrontendMessage, ) -> Pin<Box<dyn Future<Output = Result<FrontendMiddlewareOutput, Self::Error>> + 'a>>
Intercepts a client-originated message after server-role middleware and before client-role middleware.
Sourcefn backend<'a>(
&'a mut self,
_server: &'a ServerContext,
_client: &'a ClientContext,
_state: &'a mut State,
message: BackendMessage,
) -> Pin<Box<dyn Future<Output = Result<BackendMiddlewareOutput, Self::Error>> + 'a>>
fn backend<'a>( &'a mut self, _server: &'a ServerContext, _client: &'a ClientContext, _state: &'a mut State, message: BackendMessage, ) -> Pin<Box<dyn Future<Output = Result<BackendMiddlewareOutput, Self::Error>> + 'a>>
Intercepts a PostgreSQL-originated message after client-role middleware and before server-role middleware.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".