StatusCode

Struct StatusCode 

Source
pub struct StatusCode(/* private fields */);
Expand description

HTTP status code.

Implementations§

Source§

impl StatusCode

Source

pub const OK: StatusCode

Source

pub const CREATED: StatusCode

Source

pub const ACCEPTED: StatusCode

Source

pub const NO_CONTENT: StatusCode

Source

pub const MOVED_PERMANENTLY: StatusCode

Source

pub const FOUND: StatusCode

Source

pub const SEE_OTHER: StatusCode

Source

pub const NOT_MODIFIED: StatusCode

Source

pub const TEMPORARY_REDIRECT: StatusCode

Source

pub const PERMANENT_REDIRECT: StatusCode

Source

pub const BAD_REQUEST: StatusCode

Source

pub const UNAUTHORIZED: StatusCode

Source

pub const FORBIDDEN: StatusCode

Source

pub const NOT_FOUND: StatusCode

Source

pub const METHOD_NOT_ALLOWED: StatusCode

Source

pub const CONFLICT: StatusCode

Source

pub const GONE: StatusCode

Source

pub const UNPROCESSABLE_ENTITY: StatusCode

Source

pub const TOO_MANY_REQUESTS: StatusCode

Source

pub const INTERNAL_SERVER_ERROR: StatusCode

Source

pub const NOT_IMPLEMENTED: StatusCode

Source

pub const BAD_GATEWAY: StatusCode

Source

pub const SERVICE_UNAVAILABLE: StatusCode

Source

pub const GATEWAY_TIMEOUT: StatusCode

Source

pub const fn from_u16(code: u16) -> Self

Creates a status code from a raw u16 value.

Source

pub const fn as_u16(&self) -> u16

Returns the raw status code value.

Source

pub const fn is_success(&self) -> bool

Returns true if this is a success status (2xx).

Source

pub const fn is_redirection(&self) -> bool

Returns true if this is a redirection status (3xx).

Source

pub const fn is_client_error(&self) -> bool

Returns true if this is a client error status (4xx).

Source

pub const fn is_server_error(&self) -> bool

Returns true if this is a server error status (5xx).

Trait Implementations§

Source§

impl Clone for StatusCode

Source§

fn clone(&self) -> StatusCode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StatusCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for StatusCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<u16> for StatusCode

Source§

fn from(code: u16) -> Self

Converts to this type from the input type.
Source§

impl Hash for StatusCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoResponse for StatusCode

Source§

fn into_response(self) -> Response

Converts this value into a Response.
Source§

impl PartialEq for StatusCode

Source§

fn eq(&self, other: &StatusCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for StatusCode

Source§

impl Eq for StatusCode

Source§

impl StructuralPartialEq for StatusCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.