pub struct StatusCode(/* private fields */);
Implementations§
source§impl StatusCode
impl StatusCode
sourcepub fn try_from_status(status: u16) -> Result<Self, u16>
pub fn try_from_status(status: u16) -> Result<Self, u16>
Constructs an status code and return an error if the value is an invalid status code.
sourcepub fn is_redirection(&self) -> bool
pub fn is_redirection(&self) -> bool
Whether if this status is a redirections status code.
sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Whether if this status is a client error status code.
sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Whether if this status is a server error status code.
sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Whether if this status code is between 200-299.
source§impl StatusCode
impl StatusCode
pub const CONTINUE: StatusCode = _
pub const SWITCHING_PROTOCOLS: StatusCode = _
pub const EARLY_HINTS: 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 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 UNUSED: 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_CONTENT: StatusCode = _
pub const LOCKED: StatusCode = _
pub const FAILED_DEPENDENCY: StatusCode = _
pub const TOO_EARLY: 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 = _
sourcepub fn reason_phrase(&self) -> Option<&str>
pub fn reason_phrase(&self) -> Option<&str>
Returns the reason for this status code.
Trait Implementations§
source§impl Clone for StatusCode
impl Clone for StatusCode
source§fn clone(&self) -> StatusCode
fn clone(&self) -> StatusCode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for StatusCode
impl Debug for StatusCode
source§impl Default for StatusCode
impl Default for StatusCode
source§impl Display for StatusCode
impl Display for StatusCode
source§impl Hash for StatusCode
impl Hash for StatusCode
source§impl Ord for StatusCode
impl Ord for StatusCode
source§fn cmp(&self, other: &StatusCode) -> Ordering
fn cmp(&self, other: &StatusCode) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for StatusCode
impl PartialEq for StatusCode
source§impl PartialOrd for StatusCode
impl PartialOrd 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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)