Struct tower_http::map_request_body::MapRequestBodyLayer
source · pub struct MapRequestBodyLayer<F> { /* private fields */ }
Available on crate feature
map-request-body
only.Expand description
Apply a transformation to the request body.
See the module docs for an example.
Implementations§
source§impl<F> MapRequestBodyLayer<F>
impl<F> MapRequestBodyLayer<F>
sourcepub fn new(f: F) -> Self
pub fn new(f: F) -> Self
Create a new MapRequestBodyLayer
.
F
is expected to be a function that takes a body and returns another body.
Trait Implementations§
source§impl<F: Clone> Clone for MapRequestBodyLayer<F>
impl<F: Clone> Clone for MapRequestBodyLayer<F>
source§fn clone(&self) -> MapRequestBodyLayer<F>
fn clone(&self) -> MapRequestBodyLayer<F>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more