#[non_exhaustive]pub enum HttpStatus {
Informational(InformationalResponse),
Success(SuccessResponse),
Redirection(RedirectionResponse),
ClientError(ClientErrorResponse),
ServerError(ServerErrorResponse),
}Expand description
§Wikipedia:
The status code is a three-digit, decimal, integer value that represents the disposition of the server’s attempt to satisfy the client’s request. Generally, a client handles a response primarily based on the status code and secondarily on response header fields. A client may not understand each status code that a server reports but it must understand the class as indicated by the first digit and treat an unrecognized code as equivalent to the x00 code of that class.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Informational(InformationalResponse)
Status range 1xx - See InformationalResponse for more info
Success(SuccessResponse)
Status range 2xx - See SuccessResponse for more info
Redirection(RedirectionResponse)
Status range 3xx - See RedirectionResponse for more info
ClientError(ClientErrorResponse)
Status range 4xx - See ClientErrorResponse for more info
ServerError(ServerErrorResponse)
Status range 5xx - See ServerErrorResponse for more info
Implementations§
Source§impl HttpStatus
impl HttpStatus
pub const INTERNAL_SERVER_ERROR: Self
pub const UNAUTHORIZED: Self
pub const NOT_FOUND: Self
pub const FORBIDDEN: Self
pub const BAD_REQUEST: Self
pub const TOO_MANY_REQUESTS: Self
pub const OK: Self
pub const MOVED_PERMANENTLY: Self
Trait Implementations§
Source§impl Clone for HttpStatus
impl Clone for HttpStatus
Source§fn clone(&self) -> HttpStatus
fn clone(&self) -> HttpStatus
Returns a duplicate 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 HttpStatus
impl Debug for HttpStatus
Source§impl Default for HttpStatus
impl Default for HttpStatus
Source§impl Display for HttpStatus
impl Display for HttpStatus
Source§impl From<ClientErrorResponse> for HttpStatus
impl From<ClientErrorResponse> for HttpStatus
Source§fn from(val: ClientErrorResponse) -> Self
fn from(val: ClientErrorResponse) -> Self
Converts to this type from the input type.
Source§impl From<InformationalResponse> for HttpStatus
impl From<InformationalResponse> for HttpStatus
Source§fn from(val: InformationalResponse) -> Self
fn from(val: InformationalResponse) -> Self
Converts to this type from the input type.
Source§impl From<RedirectionResponse> for HttpStatus
impl From<RedirectionResponse> for HttpStatus
Source§fn from(val: RedirectionResponse) -> Self
fn from(val: RedirectionResponse) -> Self
Converts to this type from the input type.
Source§impl From<ServerErrorResponse> for HttpStatus
impl From<ServerErrorResponse> for HttpStatus
Source§fn from(val: ServerErrorResponse) -> Self
fn from(val: ServerErrorResponse) -> Self
Converts to this type from the input type.
Source§impl From<SuccessResponse> for HttpStatus
impl From<SuccessResponse> for HttpStatus
Source§fn from(val: SuccessResponse) -> Self
fn from(val: SuccessResponse) -> Self
Converts to this type from the input type.
Source§impl Hash for HttpStatus
impl Hash for HttpStatus
Source§impl Ord for HttpStatus
impl Ord for HttpStatus
Source§fn cmp(&self, other: &HttpStatus) -> Ordering
fn cmp(&self, other: &HttpStatus) -> 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 HttpStatus
impl PartialEq for HttpStatus
Source§impl PartialOrd for HttpStatus
impl PartialOrd for HttpStatus
impl Eq for HttpStatus
impl StructuralPartialEq for HttpStatus
Auto Trait Implementations§
impl Freeze for HttpStatus
impl RefUnwindSafe for HttpStatus
impl Send for HttpStatus
impl Sync for HttpStatus
impl Unpin for HttpStatus
impl UnwindSafe for HttpStatus
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