pub trait RequestMiddleware: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn on_request<'life0, 'life1, 'async_trait>(
&'life0 self,
req: Request,
cx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Flow> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable identifier used for info! registration logs and test
introspection. Return a &'static str literal.
Sourcefn on_request<'life0, 'life1, 'async_trait>(
&'life0 self,
req: Request,
cx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Flow> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_request<'life0, 'life1, 'async_trait>(
&'life0 self,
req: Request,
cx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Flow> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Inspect or transform the request. Variants the middleware does
not care about return Flow::Continue(req) unchanged.