pub trait IntoStatusCode {
// Required method
fn into_status_code(self) -> StatusCode;
}Expand description
A status code given as a number or a StatusCode, so abort(404) and
abort(StatusCode::NOT_FOUND) both work.
Required Methods§
Sourcefn into_status_code(self) -> StatusCode
fn into_status_code(self) -> StatusCode
Returns the status code.
§Panics
Panics when a number isn’t a status code from 100 to 999. Such a number is a mistake in
the code, like an unknown StatusCode constant.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".