Skip to main content

IntermediaryMiddleware

Trait IntermediaryMiddleware 

Source
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§

Source

type Error

Application-defined interception failure.

Provided Methods§

Source

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.

Source

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".

Implementors§

Source§

impl<State, ServerContext, ClientContext> IntermediaryMiddleware<State, ServerContext, ClientContext> for IdentityIntermediaryMiddleware