pub trait OutboundHttpInterceptor: Send + Sync {
// Required method
fn intercept<'life0, 'async_trait>(
&'life0 self,
request: InterceptRequest,
) -> Pin<Box<dyn Future<Output = HttpResult<InterceptOutcome>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
An outbound HTTP request interceptor to be used with
super::InstanceState::set_request_interceptor
.
Required Methods§
Sourcefn intercept<'life0, 'async_trait>(
&'life0 self,
request: InterceptRequest,
) -> Pin<Box<dyn Future<Output = HttpResult<InterceptOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn intercept<'life0, 'async_trait>(
&'life0 self,
request: InterceptRequest,
) -> Pin<Box<dyn Future<Output = HttpResult<InterceptOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Intercept an outgoing HTTP request.
If this method returns InterceptOutcome::Continue
, the (possibly
updated) request will be passed on to the default outgoing request
handler.
If this method returns InterceptOutcome::Complete
, the inner result
will be returned as the result of the request, bypassing the default
handler. The request
will also be dropped immediately.