Skip to main content

IntoStatusCode

Trait IntoStatusCode 

Source
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§

Source

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".

Implementations on Foreign Types§

Source§

impl IntoStatusCode for u16

Implementors§