pub trait HttpMiddleware: Send + Sync {
// Required method
fn name(&self) -> &'static str;
// Provided methods
fn before<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 mut Request,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn after<'life0, 'life1, 'async_trait>(
&'life0 self,
response: &'life1 mut Response,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn priority(&self) -> i32 { ... }
}
Expand description
Trait for HTTP middleware
Required Methods§
Provided Methods§
Sourcefn before<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 mut Request,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 mut Request,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Processes the request before it reaches the handler