pub trait ResponseAssert {
// Required methods
fn assert_status(&self, code: u16) -> &Self;
fn json<T>(&self) -> T
where T: DeserializeOwned;
fn json_value(&self) -> Value;
}Expand description
Fluent assertions for HTTP responses in tests.
Required Methods§
Sourcefn assert_status(&self, code: u16) -> &Self
fn assert_status(&self, code: u16) -> &Self
Panic unless status matches code.
Sourcefn json<T>(&self) -> Twhere
T: DeserializeOwned,
fn json<T>(&self) -> Twhere
T: DeserializeOwned,
Deserialize buffered JSON body; panics on failure.
Sourcefn json_value(&self) -> Value
fn json_value(&self) -> Value
Parse buffered body as serde_json::Value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".