pub trait HttpInterceptor: Send + Sync {
// Required methods
fn before_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 mut HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn after_response<'life0, 'life1, 'async_trait>(
&'life0 self,
response: &'life1 mut HttpResponse,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
Request/Response interceptor trait
Required Methods§
Sourcefn before_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 mut HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 mut HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called before sending a request
Sourcefn after_response<'life0, 'life1, 'async_trait>(
&'life0 self,
response: &'life1 mut HttpResponse,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn after_response<'life0, 'life1, 'async_trait>(
&'life0 self,
response: &'life1 mut HttpResponse,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called after receiving a response