Trait body_image_futio::RequestRecorder
source · pub trait RequestRecorder<B>where
B: Payload + Send,{
fn record(&mut self) -> Result<RequestRecord<B>, Flare>;
fn record_body<BB>(&mut self, body: BB) -> Result<RequestRecord<B>, Flare>
where
BB: Into<Bytes>;
fn record_body_image(
&mut self,
body: BodyImage,
tune: &Tunables
) -> Result<RequestRecord<B>, Flare>;
}
Expand description
Extension trait for http::request::Builder
, to enable recording key
portions of the request for the final Dialog
.
Other request fields (method
, uri
, headers
) are recorded by clone
,
after finishing the request.
The request body is cloned in advance of finishing the request, though
this is inexpensive via Bytes::clone
or BodyImage::clone
. Other
request fields (method
, uri
, headers
) are recorded by clone
, after
finishing the request.
Required Methods§
sourcefn record(&mut self) -> Result<RequestRecord<B>, Flare>
fn record(&mut self) -> Result<RequestRecord<B>, Flare>
Short-hand for completing the builder with an empty body, as is the case with many HTTP request methods (e.g. GET).
sourcefn record_body<BB>(&mut self, body: BB) -> Result<RequestRecord<B>, Flare>where
BB: Into<Bytes>,
fn record_body<BB>(&mut self, body: BB) -> Result<RequestRecord<B>, Flare>where
BB: Into<Bytes>,
Complete the builder with any body that can be converted to a (Ram)
Bytes
buffer.
sourcefn record_body_image(
&mut self,
body: BodyImage,
tune: &Tunables
) -> Result<RequestRecord<B>, Flare>
fn record_body_image(
&mut self,
body: BodyImage,
tune: &Tunables
) -> Result<RequestRecord<B>, Flare>
Complete the builder with a BodyImage
for the request body.