Trait Middleware

Source
pub trait Middleware: Send + Sync {
    // Required methods
    fn process_request<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: Request,
        context: &'life1 RequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<Request, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn process_response<'life0, 'life1, 'async_trait>(
        &'life0 self,
        response: Response,
        context: &'life1 RequestContext,
    ) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for middleware components

Required Methods§

Source

fn process_request<'life0, 'life1, 'async_trait>( &'life0 self, request: Request, context: &'life1 RequestContext, ) -> Pin<Box<dyn Future<Output = Result<Request, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Process incoming request

Source

fn process_response<'life0, 'life1, 'async_trait>( &'life0 self, response: Response, context: &'life1 RequestContext, ) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Process outgoing response

Implementors§