pub trait ResponseExt {
// Required methods
fn assert_status(&self, expected: StatusCode) -> &Self;
fn assert_success(&self) -> &Self;
fn assert_client_error(&self) -> &Self;
fn assert_server_error(&self) -> &Self;
fn assert_ok(&self) -> &Self;
fn assert_created(&self) -> &Self;
fn assert_no_content(&self) -> &Self;
fn assert_bad_request(&self) -> &Self;
fn assert_unauthorized(&self) -> &Self;
fn assert_forbidden(&self) -> &Self;
fn assert_not_found(&self) -> &Self;
}Expand description
Extension trait for Response assertions
Required Methods§
Sourcefn assert_status(&self, expected: StatusCode) -> &Self
fn assert_status(&self, expected: StatusCode) -> &Self
Assert status code
Sourcefn assert_success(&self) -> &Self
fn assert_success(&self) -> &Self
Assert 2xx success
Sourcefn assert_client_error(&self) -> &Self
fn assert_client_error(&self) -> &Self
Assert 4xx client error
Sourcefn assert_server_error(&self) -> &Self
fn assert_server_error(&self) -> &Self
Assert 5xx server error
Sourcefn assert_created(&self) -> &Self
fn assert_created(&self) -> &Self
Assert that the response status is 201 Created.
Sourcefn assert_no_content(&self) -> &Self
fn assert_no_content(&self) -> &Self
Assert that the response status is 204 No Content.
Sourcefn assert_bad_request(&self) -> &Self
fn assert_bad_request(&self) -> &Self
Assert that the response status is 400 Bad Request.
Assert that the response status is 401 Unauthorized.
Sourcefn assert_forbidden(&self) -> &Self
fn assert_forbidden(&self) -> &Self
Assert that the response status is 403 Forbidden.
Sourcefn assert_not_found(&self) -> &Self
fn assert_not_found(&self) -> &Self
Assert that the response status is 404 Not Found.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.