Enum StatusCode

Source
pub enum StatusCode {
Show 41 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, ImATeapot, InternalServerError, NotImplemented, BadGateway, ServiceUnavailable, GatewayTimeout, HTTPVersionNotSupported,
}
Expand description

Represents all the known and defined StatusCodes

Variants§

§

Continue

The Request should be continued by the Client

§

SwitchingProtocols

The Server acknowledges and accepts the Request to switch to another Protocol

§

OK

The Request has successfully been processed

§

Created

The Request successfully created a new Ressource

§

Accepted

The Request was successfully accpeted to be processed but has not been completed yet

§

NonAuthoritativeInformation

The returned Metainformation was not returned by the Origin-Server

§

NoContent

The Request was successful but there is no Data returned

§

ResetContent

The Request has been successfully fulfilled and the Client can clear its input Content

§

PartialContent

The requested partial Data has been fulfilled

§

MultipleChoices

The requested Ressource corresponds multiple Ressources

§

MovedPermanently

The Requested Data was moved to another URI

§

Found

The requested Ressource temporarily resides under a different URI

§

SeeOther

The Response to this Request can be found at a different URI

§

NotModified

The requested Ressource was not modified between the last Request and now

§

UseProxy

The Ressource can only be accessed through a Proxy

§

TemporaryRedirect

The requested Ressource temporarily resides under a different URI

§

BadRequest

The Request was not properly send or received

§

Unauthorized

The Request tried to access something it is not authorized to do

§

PaymentRequired

Reserved for future use

§

Forbidden

The requested Ressource is not allowed to be accessed

§

NotFound

The requested Ressource could not be found

§

MethodNotAllowed

The requested Method is not allowed for the specified Ressource

§

NotAcceptable

The Ressource is not capable of accepting the Request

§

ProxyAuthenticationRequired

The Client should first Authenticate with a Proxy and before attempting the Request again

§

RequestTimeOut

The Server decided that the Client took to long and the Request timed out

§

Conflict

Request could not complete because there was a conflict current State of the Ressource

§

Gone

The Ressource is no longer available

§

LengthRequired

The Server only accepts Requests where the Content-Length is set

§

PreconditionFailed

The given Precondition failed

§

RequestEntityTooLarge

The Request-Entity was larger than what the Server allows

§

RequestURITooLarge

The URI is longer than what the Server allows

§

UnsupportedMediaType

The Media-Type is not supported by the Server for this ressource

§

RequestedRangeNotSatisfiable

The Requested Range could not be satisfied by the Server

§

ExpectationFailed

The given Expectation has failed

§

ImATeapot

An April Fool’s Status-Code that some servers use for a variety of Situations

§

InternalServerError

The Server Processing encountered some internal Problem and could not process the Request

§

NotImplemented

Some requested Functionality is not implemented on the Server

§

BadGateway

An Error occured at a Gateway while sending the Request to the Target-Server

§

ServiceUnavailable

The requested Service is currently unavailable

§

GatewayTimeout

The Gateway did not received a Response in time

§

HTTPVersionNotSupported

The requested HTTP-Version is not supported by the Server

Implementations§

Source§

impl StatusCode

Source

pub fn parse(raw: &str) -> Option<Self>

Parses the Raw Response Status-Code to the enum

Source

pub fn serialize(&self) -> &'static str

Serialzes the given StatusCode

Source§

impl StatusCode

Source

pub fn wasm_deserialize(key: i32) -> Option<Self>

Deserializes the i32 Value to a StatusCode for easier exchange between WASM and the Host

Source

pub fn wasm_serialize(&self) -> i32

Serializes the given StatusCode to a simple i32 Value, which makes it easier to exchange between a WASM module and its host

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