pub struct ResponseDiff {
pub expected_status: u16,
pub actual_status: u16,
pub expected_body: Option<String>,
pub actual_body: String,
pub header_diffs: Vec<(String, Option<String>, Option<String>)>,
}Expand description
Request/response diff helper for test assertions.
Fields§
§expected_status: u16Expected status code.
actual_status: u16Actual status code.
expected_body: Option<String>Expected body substring or full content.
actual_body: StringActual body content.
header_diffs: Vec<(String, Option<String>, Option<String>)>Header differences (name, expected, actual).
Implementations§
Source§impl ResponseDiff
impl ResponseDiff
Sourcepub fn new(expected_status: u16, actual: &TestResponse) -> Self
pub fn new(expected_status: u16, actual: &TestResponse) -> Self
Creates a new diff from expected and actual responses.
Sourcepub fn expected_body(self, body: impl Into<String>) -> Self
pub fn expected_body(self, body: impl Into<String>) -> Self
Sets expected body for comparison.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResponseDiff
impl RefUnwindSafe for ResponseDiff
impl Send for ResponseDiff
impl Sync for ResponseDiff
impl Unpin for ResponseDiff
impl UnwindSafe for ResponseDiff
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).