Struct StatusCode
pub struct StatusCode(/* private fields */);
Expand description
Serializable HTTP status code.
Implementations§
§impl StatusCode
impl StatusCode
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 UNAVAILABLE_FOR_LEGAL_REASONS: 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
pub fn is_informational(self) -> bool
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
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
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
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
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>
pub fn canonical_reason(self) -> Option<&'static str>
The canonical reason for a given status code
Trait Implementations§
§impl Clone for StatusCode
impl Clone for StatusCode
§fn clone(&self) -> StatusCode
fn clone(&self) -> StatusCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for StatusCode
impl Debug for StatusCode
§impl<'de> Deserialize<'de> for StatusCode
impl<'de> Deserialize<'de> for StatusCode
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StatusCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StatusCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Display for StatusCode
impl Display for StatusCode
§impl From<StatusCode> for StatusCode
impl From<StatusCode> for StatusCode
§fn from(code: StatusCode) -> StatusCode
fn from(code: StatusCode) -> StatusCode
§impl From<StatusCode> for StatusCode
impl From<StatusCode> for StatusCode
§fn from(code: StatusCode) -> StatusCode
fn from(code: StatusCode) -> StatusCode
§impl Hash for StatusCode
impl Hash for StatusCode
§impl PartialEq<StatusCode> for StatusCode
impl PartialEq<StatusCode> for StatusCode
§impl PartialEq<StatusCode> for StatusCode
impl PartialEq<StatusCode> for StatusCode
§impl PartialEq for StatusCode
impl PartialEq for StatusCode
§impl Serialize for StatusCode
impl Serialize for StatusCode
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
§impl TryFrom<u16> for StatusCode
impl TryFrom<u16> for StatusCode
impl Copy for StatusCode
impl Eq for StatusCode
impl StructuralPartialEq for StatusCode
Auto Trait Implementations§
impl Freeze for StatusCode
impl RefUnwindSafe for StatusCode
impl Send for StatusCode
impl Sync for StatusCode
impl Unpin for StatusCode
impl UnwindSafe for StatusCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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