Skip to main content

StatusCode

Struct StatusCode 

Source
pub struct StatusCode(pub u16);
Expand description

Status code of a request or response.

Tuple Fields§

§0: u16

Implementations§

Source§

impl StatusCode

Source

pub const CONTINUE: StatusCode

Source

pub const SWITCHING_PROTOCOLS: StatusCode

Source

pub const PROCESSING: StatusCode

Source

pub const EARLY_HINTS: 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 IMUSED: 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 URITOO_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 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 HTTPVERSION_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 default_reason_phrase(&self) -> &'static str

Returns the default reason phrase for this status code. For example the status code 404 corresponds to “Not Found”.

Source

pub fn in_range_inc(&self, s: Self, e: Self) -> bool

Trait Implementations§

Source§

impl AsRef<u16> for StatusCode

Source§

fn as_ref(&self) -> &u16

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for StatusCode

Source§

fn clone(&self) -> StatusCode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for StatusCode

Source§

impl Debug for StatusCode

Source§

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

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

impl Eq for StatusCode

Source§

impl From<i8> for StatusCode

Source§

fn from(in_code: i8) -> StatusCode

Converts to this type from the input type.
Source§

impl From<i16> for StatusCode

Source§

fn from(in_code: i16) -> StatusCode

Converts to this type from the input type.
Source§

impl From<i32> for StatusCode

Source§

fn from(in_code: i32) -> StatusCode

Converts to this type from the input type.
Source§

impl From<u8> for StatusCode

Source§

fn from(in_code: u8) -> StatusCode

Converts to this type from the input type.
Source§

impl From<u16> for StatusCode

Source§

fn from(in_code: u16) -> StatusCode

Converts to this type from the input type.
Source§

impl From<u32> for StatusCode

Source§

fn from(in_code: u32) -> StatusCode

Converts to this type from the input type.
Source§

impl Ord for StatusCode

Source§

fn cmp(&self, other: &StatusCode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for StatusCode

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialEq<StatusCode> for u16

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialEq<u16> for StatusCode

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for StatusCode

Source§

fn partial_cmp(&self, other: &StatusCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<StatusCode> for u16

Source§

fn partial_cmp(&self, other: &StatusCode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl PartialOrd<u16> for StatusCode

Source§

fn partial_cmp(&self, other: &u16) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.