Enum fire_http_representation::header::StatusCode[][src]

#[repr(u16)]
#[non_exhaustive]
pub enum StatusCode {
Show variants Continue, SwitchingProtocols, Ok, Created, Accepted, NonAuthoritativeInformation, NoContent, ResetContent, PartialContent, MultipleChoices, MovedPermanently, Found, SeeOther, NotModified, UseProxy, TemporaryRedirect, BadRequest, Unauthorized, PaymentRequired, Forbidden, NotFound, MethodNotAllowed, NotAcceptable, ProxyAuthenticationRequired, RequestTimeout, Conflict, Gone, LengthRequired, PreconditionFailed, RequestEntityTooLarge, RequestURITooLarge, UnsupportedMediaType, RequestedRangeNotSatisfiable, ExpectationFailed, InternalServerError, NotImplemented, BadGateway, ServiceUnavailable, GatewayTimeout, HTTPVersionNotSupported,
}
Expand description

An enum of all possible http status codes.

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Continue

Continue

SwitchingProtocols

Switching Protocols

Ok

OK

Created

Created

Accepted

Accepted

NonAuthoritativeInformation

Non-Authoritative Information

NoContent

No Content

ResetContent

Reset Content

PartialContent

Partial Content

MultipleChoices

Multiple Choices

MovedPermanently

Moved Permanently

Found

Found

SeeOther

See Other

NotModified

Not Modified

UseProxy

Use Proxy

TemporaryRedirect

Temporary Redirect

BadRequest

Bad Request

Unauthorized

Unauthorized

PaymentRequired

Payment Required

Forbidden

Forbidden

NotFound

Not Found

MethodNotAllowed

Method Not Allowed

NotAcceptable

Not Acceptable

ProxyAuthenticationRequired

Proxy Authentication Required

RequestTimeout

Request Time-out

Conflict

Conflict

Gone

Gone

LengthRequired

Length Required

PreconditionFailed

Precondition Failed

RequestEntityTooLarge

Request Entity Too Large

RequestURITooLarge

Request-URI Too Large

UnsupportedMediaType

Unsupported Media Type

RequestedRangeNotSatisfiable

Requested range not satisfiable

ExpectationFailed

Expectation Failed

InternalServerError

Internal Server Error

NotImplemented

Not Implemented

BadGateway

Bad Gateway

ServiceUnavailable

Service Unavailable

GatewayTimeout

Gateway Time-out

HTTPVersionNotSupported

HTTP Version not supported

Implementations

impl StatusCode[src]

pub fn message(&self) -> &'static str[src]

Returns the corresponding message to the give StatusCode.

pub fn code(&self) -> u16[src]

Returns the corresponding number to the give StatusCode.

Trait Implementations

impl Clone for StatusCode[src]

fn clone(&self) -> StatusCode[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for StatusCode[src]

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

Formats the value using the given formatter. Read more

impl Display for StatusCode[src]

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

Formats the value using the given formatter. Read more

impl From<StatusCode> for Response[src]

fn from(status_code: StatusCode) -> Self[src]

Performs the conversion.

impl PartialEq<StatusCode> for StatusCode[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl TryFrom<u16> for StatusCode[src]

type Error = ()

The type returned in the event of a conversion error.

fn try_from(value: u16) -> Result<Self, Self::Error>[src]

Performs the conversion.

impl Copy for StatusCode[src]

impl Eq for StatusCode[src]

impl StructuralEq for StatusCode[src]

impl StructuralPartialEq for StatusCode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.