Struct tide_disco::status::StatusCode
source · pub struct StatusCode(/* private fields */);
Expand description
Serializable HTTP status code.
Implementations§
source§impl StatusCode
impl StatusCode
sourcepub 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.
sourcepub 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.
sourcepub 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.
sourcepub 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.
sourcepub 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.
sourcepub 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: Self = _
pub const SWITCHING_PROTOCOLS: Self = _
pub const PROCESSING: Self = _
pub const OK: Self = _
pub const CREATED: Self = _
pub const ACCEPTED: Self = _
pub const NON_AUTHORITATIVE_INFORMATION: Self = _
pub const NO_CONTENT: Self = _
pub const RESET_CONTENT: Self = _
pub const PARTIAL_CONTENT: Self = _
pub const MULTI_STATUS: Self = _
pub const ALREADY_REPORTED: Self = _
pub const IM_USED: Self = _
pub const MULTIPLE_CHOICES: Self = _
pub const MOVED_PERMANENTLY: Self = _
pub const FOUND: Self = _
pub const SEE_OTHER: Self = _
pub const NOT_MODIFIED: Self = _
pub const USE_PROXY: Self = _
pub const TEMPORARY_REDIRECT: Self = _
pub const PERMANENT_REDIRECT: Self = _
pub const BAD_REQUEST: Self = _
pub const UNAUTHORIZED: Self = _
pub const PAYMENT_REQUIRED: Self = _
pub const FORBIDDEN: Self = _
pub const NOT_FOUND: Self = _
pub const METHOD_NOT_ALLOWED: Self = _
pub const NOT_ACCEPTABLE: Self = _
pub const PROXY_AUTHENTICATION_REQUIRED: Self = _
pub const REQUEST_TIMEOUT: Self = _
pub const CONFLICT: Self = _
pub const GONE: Self = _
pub const LENGTH_REQUIRED: Self = _
pub const PRECONDITION_FAILED: Self = _
pub const PAYLOAD_TOO_LARGE: Self = _
pub const URI_TOO_LONG: Self = _
pub const UNSUPPORTED_MEDIA_TYPE: Self = _
pub const RANGE_NOT_SATISFIABLE: Self = _
pub const EXPECTATION_FAILED: Self = _
pub const IM_A_TEAPOT: Self = _
pub const MISDIRECTED_REQUEST: Self = _
pub const UNPROCESSABLE_ENTITY: Self = _
pub const LOCKED: Self = _
pub const FAILED_DEPENDENCY: Self = _
pub const UPGRADE_REQUIRED: Self = _
pub const PRECONDITION_REQUIRED: Self = _
pub const TOO_MANY_REQUESTS: Self = _
pub const REQUEST_HEADER_FIELDS_TOO_LARGE: Self = _
pub const UNAVAILABLE_FOR_LEGAL_REASONS: Self = _
pub const INTERNAL_SERVER_ERROR: Self = _
pub const NOT_IMPLEMENTED: Self = _
pub const BAD_GATEWAY: Self = _
pub const SERVICE_UNAVAILABLE: Self = _
pub const GATEWAY_TIMEOUT: Self = _
pub const HTTP_VERSION_NOT_SUPPORTED: Self = _
pub const VARIANT_ALSO_NEGOTIATES: Self = _
pub const INSUFFICIENT_STORAGE: Self = _
pub const LOOP_DETECTED: Self = _
pub const NOT_EXTENDED: Self = _
pub const NETWORK_AUTHENTICATION_REQUIRED: Self = _
Trait Implementations§
source§impl Clone for StatusCode
impl Clone for StatusCode
source§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 moresource§impl Debug for StatusCode
impl Debug for StatusCode
source§impl<'de> Deserialize<'de> for StatusCode
impl<'de> Deserialize<'de> for StatusCode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for StatusCode
impl Display for StatusCode
source§impl From<StatusCode> for StatusCode
impl From<StatusCode> for StatusCode
source§impl From<StatusCode> for StatusCode
impl From<StatusCode> for StatusCode
source§impl From<StatusCode> for StatusCode
impl From<StatusCode> for StatusCode
source§fn from(code: StatusCode) -> Self
fn from(code: StatusCode) -> Self
source§impl From<StatusCode> for u16
impl From<StatusCode> for u16
source§fn from(code: StatusCode) -> Self
fn from(code: StatusCode) -> Self
source§impl Hash for StatusCode
impl Hash for StatusCode
source§impl PartialEq<StatusCode> for StatusCode
impl PartialEq<StatusCode> for StatusCode
source§impl PartialEq<StatusCode> for StatusCode
impl PartialEq<StatusCode> for StatusCode
source§impl PartialEq<StatusCode> for StatusCode
impl PartialEq<StatusCode> for StatusCode
source§fn eq(&self, other: &StatusCode) -> bool
fn eq(&self, other: &StatusCode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<StatusCode> for StatusCode
impl PartialEq<StatusCode> for StatusCode
source§fn eq(&self, other: &StatusCode) -> bool
fn eq(&self, other: &StatusCode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for StatusCode
impl PartialEq for StatusCode
source§fn eq(&self, other: &StatusCode) -> bool
fn eq(&self, other: &StatusCode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for StatusCode
impl Serialize for StatusCode
source§impl TryFrom<StatusCode> for StatusCode
impl TryFrom<StatusCode> for StatusCode
source§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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more