Trait Middleware
Source pub trait Middleware: Send + Sync {
// Required methods
fn pre_process<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 mut HttpRequest,
ctx: &'life2 mut Context,
) -> Pin<Box<dyn Future<Output = Result<Option<HttpResonse>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn post_process<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
req: &'life1 mut HttpRequest,
res: &'life2 mut HttpResonse,
ctx: &'life3 mut Context,
) -> Pin<Box<dyn Future<Output = Result<Option<HttpResonse>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
}