pub struct ParsedRequest {
pub url_path: String,
pub component_parts: Parts,
pub body_json: Option<Value>,
}Expand description
Request metadata and body, decoded once per request.
§Why we eagerly collect the body
Routing decisions depend on body contents (rule-set body.json
conditions, middleware evaluation). Rather than re-collecting the
body each time a matcher asks for it, the upstream constructor
consumes the Incoming stream once and keeps the parsed JSON
around for the lifetime of the request. This is appropriate for a
mock server where payloads are small; a production proxy would want
streaming instead.
Fields§
§url_path: String§component_parts: Parts§body_json: Option<Value>Parsed JSON body, if the request had one that parsed successfully.
None here means either “no body” or “body present but not JSON”;
the two are indistinguishable at the matcher layer and we don’t
currently need to distinguish them.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ParsedRequest
impl !RefUnwindSafe for ParsedRequest
impl Send for ParsedRequest
impl Sync for ParsedRequest
impl Unpin for ParsedRequest
impl UnsafeUnpin for ParsedRequest
impl !UnwindSafe for ParsedRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more