StatusCode

Struct StatusCode 

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

Serializable HTTP status code.

Implementations§

Source§

impl StatusCode

Source

pub const CONTINUE: StatusCode

Source

pub const SWITCHING_PROTOCOLS: StatusCode

Source

pub const PROCESSING: StatusCode

Source

pub const OK: StatusCode

Source

pub const CREATED: StatusCode

Source

pub const ACCEPTED: StatusCode

Source

pub const NON_AUTHORITATIVE_INFORMATION: StatusCode

Source

pub const NO_CONTENT: StatusCode

Source

pub const RESET_CONTENT: StatusCode

Source

pub const PARTIAL_CONTENT: StatusCode

Source

pub const MULTI_STATUS: StatusCode

Source

pub const ALREADY_REPORTED: StatusCode

Source

pub const IM_USED: StatusCode

Source

pub const MULTIPLE_CHOICES: 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 USE_PROXY: 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 PAYMENT_REQUIRED: StatusCode

Source

pub const FORBIDDEN: StatusCode

Source

pub const NOT_FOUND: StatusCode

Source

pub const METHOD_NOT_ALLOWED: StatusCode

Source

pub const NOT_ACCEPTABLE: StatusCode

Source

pub const PROXY_AUTHENTICATION_REQUIRED: StatusCode

Source

pub const REQUEST_TIMEOUT: StatusCode

Source

pub const CONFLICT: StatusCode

Source

pub const GONE: StatusCode

Source

pub const LENGTH_REQUIRED: StatusCode

Source

pub const PRECONDITION_FAILED: StatusCode

Source

pub const PAYLOAD_TOO_LARGE: StatusCode

Source

pub const URI_TOO_LONG: StatusCode

Source

pub const UNSUPPORTED_MEDIA_TYPE: StatusCode

Source

pub const RANGE_NOT_SATISFIABLE: StatusCode

Source

pub const EXPECTATION_FAILED: StatusCode

Source

pub const IM_A_TEAPOT: StatusCode

Source

pub const MISDIRECTED_REQUEST: StatusCode

Source

pub const UNPROCESSABLE_ENTITY: StatusCode

Source

pub const LOCKED: StatusCode

Source

pub const FAILED_DEPENDENCY: StatusCode

Source

pub const UPGRADE_REQUIRED: StatusCode

Source

pub const PRECONDITION_REQUIRED: StatusCode

Source

pub const TOO_MANY_REQUESTS: StatusCode

Source

pub const REQUEST_HEADER_FIELDS_TOO_LARGE: 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 HTTP_VERSION_NOT_SUPPORTED: StatusCode

Source

pub const VARIANT_ALSO_NEGOTIATES: StatusCode

Source

pub const INSUFFICIENT_STORAGE: StatusCode

Source

pub const LOOP_DETECTED: StatusCode

Source

pub const NOT_EXTENDED: StatusCode

Source

pub const NETWORK_AUTHENTICATION_REQUIRED: StatusCode

Source

pub fn is_informational(self) -> bool

Returns true if the status code is 1xx range.

If this returns true it indicates that the request was received, continuing process.

Source

pub fn is_success(self) -> bool

Returns true if the status code is the 2xx range.

If this returns true it indicates that the request was successfully received, understood, and accepted.

Source

pub fn is_redirection(self) -> bool

Returns true if the status code is the 3xx range.

If this returns true it indicates that further action needs to be taken in order to complete the request.

Source

pub fn is_client_error(self) -> bool

Returns true if the status code is the 4xx range.

If this returns true it indicates that the request contains bad syntax or cannot be fulfilled.

Source

pub fn is_server_error(self) -> bool

Returns true if the status code is the 5xx range.

If this returns true it indicates that the server failed to fulfill an apparently valid request.

Source

pub fn canonical_reason(self) -> Option<&'static str>

The canonical reason for a given status code

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<(), Error>

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

impl<'de> Deserialize<'de> for StatusCode

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<StatusCode, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for StatusCode

Source§

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

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

impl From<StatusCode> for StatusCode

Source§

fn from(code: StatusCode) -> StatusCode

Converts to this type from the input type.
Source§

impl From<StatusCode> for StatusCode

Source§

fn from(code: StatusCode) -> StatusCode

Converts to this type from the input type.
Source§

impl Hash for StatusCode

Source§

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

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 PartialEq<StatusCode> 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 PartialEq<StatusCode> 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 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 Serialize for StatusCode

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<u16> for StatusCode

Source§

type Error = <StatusCode as TryFrom<u16>>::Error

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

fn try_from( code: u16, ) -> Result<StatusCode, <StatusCode as TryFrom<u16>>::Error>

Performs the conversion.
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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,