Skip to main content

Middleware

Trait Middleware 

Source
pub trait Middleware: Send + Sync {
    // Required method
    fn process<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: MiddlewareContext,
        next: Box<dyn FnOnce(MiddlewareContext) -> Pin<Box<dyn Future<Output = Result<MiddlewareContext>> + Send + 'life1>> + Send + 'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<MiddlewareContext>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn name(&self) -> &str { ... }
}

Required Methods§

Source

fn process<'life0, 'life1, 'async_trait>( &'life0 self, ctx: MiddlewareContext, next: Box<dyn FnOnce(MiddlewareContext) -> Pin<Box<dyn Future<Output = Result<MiddlewareContext>> + Send + 'life1>> + Send + 'life1>, ) -> Pin<Box<dyn Future<Output = Result<MiddlewareContext>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn name(&self) -> &str

Implementors§