pub struct CapturedPost {
pub headers: BTreeMap<String, String>,
pub body: Value,
}Expand description
A snapshot of one POST the mock captured — headers (lowercased names, string values) plus a parsed-JSON body. Structured so a failing assertion in a test prints the full payload rather than a byte vector the human has to decode by hand.
Fields§
§headers: BTreeMap<String, String>Header name → value, keys lowercased. Only the headers the
mock actually inspects are captured (see
[capture_relevant_headers]); a test that wants to assert a
custom header adds it to the capture list in one place.
body: ValueParsed JSON body. When the client sends malformed JSON the
handler short-circuits with 400 before capturing, so this is
always a valid Value.
Trait Implementations§
Source§impl Clone for CapturedPost
impl Clone for CapturedPost
Source§fn clone(&self) -> CapturedPost
fn clone(&self) -> CapturedPost
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for CapturedPost
impl RefUnwindSafe for CapturedPost
impl Send for CapturedPost
impl Sync for CapturedPost
impl Unpin for CapturedPost
impl UnsafeUnpin for CapturedPost
impl UnwindSafe for CapturedPost
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