pub trait OnBodyDrop<ReqB> {
type Intermediate: Send + 'static;
type Callback: OnDropCallback;
// Required methods
fn make_at_call(&mut self, request: &Request<ReqB>) -> Self::Intermediate;
fn make_at_response(
&mut self,
intermediate: Self::Intermediate,
response_parts: &Parts,
) -> Self::Callback;
}Available on crate feature
on-early-drop only.Expand description
Hook fired when the response body is dropped before reaching end-of-stream.
See the module docs for the example and phase breakdown.
Required Associated Types§
Sourcetype Intermediate: Send + 'static
type Intermediate: Send + 'static
State carried from make_at_call to
make_at_response.
Sourcetype Callback: OnDropCallback
type Callback: OnDropCallback
The final callback produced for each response.
Required Methods§
Sourcefn make_at_call(&mut self, request: &Request<ReqB>) -> Self::Intermediate
fn make_at_call(&mut self, request: &Request<ReqB>) -> Self::Intermediate
Capture request-time context.
Sourcefn make_at_response(
&mut self,
intermediate: Self::Intermediate,
response_parts: &Parts,
) -> Self::Callback
fn make_at_response( &mut self, intermediate: Self::Intermediate, response_parts: &Parts, ) -> Self::Callback
Capture response-time context and produce the final callback.
Implementations on Foreign Types§
Source§impl<ReqB> OnBodyDrop<ReqB> for ()
impl<ReqB> OnBodyDrop<ReqB> for ()
type Intermediate = ()
type Callback = NoopDropCallback
fn make_at_call(&mut self, _request: &Request<ReqB>) -> Self::Intermediate
fn make_at_response( &mut self, _intermediate: Self::Intermediate, _response_parts: &Parts, ) -> Self::Callback
Implementors§
Source§impl<F, G, C, ReqB> OnBodyDrop<ReqB> for OnBodyDropFn<F>
impl<F, G, C, ReqB> OnBodyDrop<ReqB> for OnBodyDropFn<F>
Source§impl<F, ReqB> OnBodyDrop<ReqB> for EarlyDropsAsFailures<F>
Available on crate feature trace only.
impl<F, ReqB> OnBodyDrop<ReqB> for EarlyDropsAsFailures<F>
Available on crate feature
trace only.