pub struct RequestMutation {
pub headers: Vec<(String, String)>,
pub body: Option<Bytes>,
}Expand description
An owned, mutable view of an outgoing request’s headers and body, handed to a
ModifyRequestFn.
Headers are a Vec<(String, String)> rather than a map, so order is preserved
and duplicate header names are kept as separate entries rather than collapsed.
Fields§
§headers: Vec<(String, String)>The request’s headers, in wire order.
body: Option<Bytes>The request’s body, if any and if readable.
None here means there was either no body to begin with, or the body exists
but couldn’t be read without consuming a stream (the same limitation
HttpAcl::is_valid’s body parameter already has).
Leaving this as None on the way out never clears an existing body - it is
only ever an instruction to leave the body untouched, so a ModifyRequestFn
that only wants to touch headers can never accidentally truncate a body it was
never shown. Set it to Some(bytes) to replace the body wholesale.
Trait Implementations§
Source§impl Clone for RequestMutation
impl Clone for RequestMutation
Source§fn clone(&self) -> RequestMutation
fn clone(&self) -> RequestMutation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more