Struct surf_disco::StatusCode
pub struct StatusCode(/* private fields */);
Expand description
Serializable HTTP status code.
Implementations§
§impl StatusCode
impl 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
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 = _
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
§fn eq(&self, other: &StatusCode) -> bool
fn eq(&self, other: &StatusCode) -> bool
self
and other
values to be equal, and is used
by ==
.§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
§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