Struct surf_disco::StatusCode

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

Serializable HTTP status code.

Implementations§

§

impl StatusCode

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.

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.

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.

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.

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.

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

The canonical reason for a given status code

pub const CONTINUE: StatusCode = _

pub const SWITCHING_PROTOCOLS: StatusCode = _

pub const PROCESSING: StatusCode = _

pub const OK: StatusCode = _

pub const CREATED: StatusCode = _

pub const ACCEPTED: StatusCode = _

pub const NON_AUTHORITATIVE_INFORMATION: StatusCode = _

pub const NO_CONTENT: StatusCode = _

pub const RESET_CONTENT: StatusCode = _

pub const PARTIAL_CONTENT: StatusCode = _

pub const MULTI_STATUS: StatusCode = _

pub const ALREADY_REPORTED: StatusCode = _

pub const IM_USED: StatusCode = _

pub const MULTIPLE_CHOICES: StatusCode = _

pub const MOVED_PERMANENTLY: StatusCode = _

pub const FOUND: StatusCode = _

pub const SEE_OTHER: StatusCode = _

pub const NOT_MODIFIED: StatusCode = _

pub const USE_PROXY: StatusCode = _

pub const TEMPORARY_REDIRECT: StatusCode = _

pub const PERMANENT_REDIRECT: StatusCode = _

pub const BAD_REQUEST: StatusCode = _

pub const UNAUTHORIZED: StatusCode = _

pub const PAYMENT_REQUIRED: StatusCode = _

pub const FORBIDDEN: StatusCode = _

pub const NOT_FOUND: StatusCode = _

pub const METHOD_NOT_ALLOWED: StatusCode = _

pub const NOT_ACCEPTABLE: StatusCode = _

pub const PROXY_AUTHENTICATION_REQUIRED: StatusCode = _

pub const REQUEST_TIMEOUT: StatusCode = _

pub const CONFLICT: StatusCode = _

pub const GONE: StatusCode = _

pub const LENGTH_REQUIRED: StatusCode = _

pub const PRECONDITION_FAILED: StatusCode = _

pub const PAYLOAD_TOO_LARGE: StatusCode = _

pub const URI_TOO_LONG: StatusCode = _

pub const UNSUPPORTED_MEDIA_TYPE: StatusCode = _

pub const RANGE_NOT_SATISFIABLE: StatusCode = _

pub const EXPECTATION_FAILED: StatusCode = _

pub const IM_A_TEAPOT: StatusCode = _

pub const MISDIRECTED_REQUEST: StatusCode = _

pub const UNPROCESSABLE_ENTITY: StatusCode = _

pub const LOCKED: StatusCode = _

pub const FAILED_DEPENDENCY: StatusCode = _

pub const UPGRADE_REQUIRED: StatusCode = _

pub const PRECONDITION_REQUIRED: StatusCode = _

pub const TOO_MANY_REQUESTS: StatusCode = _

pub const REQUEST_HEADER_FIELDS_TOO_LARGE: StatusCode = _

pub const INTERNAL_SERVER_ERROR: StatusCode = _

pub const NOT_IMPLEMENTED: StatusCode = _

pub const BAD_GATEWAY: StatusCode = _

pub const SERVICE_UNAVAILABLE: StatusCode = _

pub const GATEWAY_TIMEOUT: StatusCode = _

pub const HTTP_VERSION_NOT_SUPPORTED: StatusCode = _

pub const VARIANT_ALSO_NEGOTIATES: StatusCode = _

pub const INSUFFICIENT_STORAGE: StatusCode = _

pub const LOOP_DETECTED: StatusCode = _

pub const NOT_EXTENDED: StatusCode = _

pub const NETWORK_AUTHENTICATION_REQUIRED: StatusCode = _

Trait Implementations§

§

impl Clone for StatusCode

§

fn clone(&self) -> StatusCode

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
§

impl Debug for StatusCode

§

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

Formats the value using the given formatter. Read more
§

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

§

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
§

impl Display for StatusCode

§

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

Formats the value using the given formatter. Read more
§

impl From<StatusCode> for StatusCode

§

fn from(code: StatusCode) -> StatusCode

Converts to this type from the input type.
§

impl From<StatusCode> for StatusCode

§

fn from(code: StatusCode) -> StatusCode

Converts to this type from the input type.
§

impl Hash for StatusCode

§

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
§

impl PartialEq<StatusCode> for StatusCode

§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl PartialEq<StatusCode> for StatusCode

§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl PartialEq for StatusCode

§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

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

impl Serialize for StatusCode

§

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
§

impl TryFrom<u16> for StatusCode

§

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

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

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

Performs the conversion.
§

impl Copy for StatusCode

§

impl Eq for StatusCode

§

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
§

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

§

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

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

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

§

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

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

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

§

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.

§

impl<T> Instrument for T

§

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

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

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

§

type Output = T

Should always be Self
source§

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

§

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§

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

§

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

§

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

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

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