Middleware

Trait Middleware 

Source
pub trait Middleware: Send + Sync {
    // Required method
    fn call<'life0, 'async_trait>(
        &'life0 self,
        req: Request,
        next: Next,
    ) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for middleware components

Required Methods§

Source

fn call<'life0, 'async_trait>( &'life0 self, req: Request, next: Next, ) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Process a request through the middleware

Implementors§