pub trait Middleware: Send + Sync {
// Provided methods
fn before<'life0, 'async_trait>(
&'life0 self,
request: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn after<'life0, 'async_trait>(
&'life0 self,
request: Value,
response: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn on_error<'life0, 'async_trait>(
&'life0 self,
request: Value,
error: Error,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Middleware trait for request/response processing
Provided Methods§
Sourcefn before<'life0, 'async_trait>(
&'life0 self,
request: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn before<'life0, 'async_trait>(
&'life0 self,
request: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process request before handler execution Returns modified request or error