pub struct StatusCode(/* private fields */);
Expand description
Serializable HTTP status code.
Implementations§
Source§impl StatusCode
impl StatusCode
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
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
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§fn from(code: StatusCode) -> Self
fn from(code: StatusCode) -> Self
Source§impl From<StatusCode> for StatusCode
impl From<StatusCode> for StatusCode
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§impl PartialEq<StatusCode> for StatusCode
impl PartialEq<StatusCode> for StatusCode
Source§impl PartialEq for StatusCode
impl PartialEq for StatusCode
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: 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>
§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