http_type/status_code/
type.rs

1/// Enumeration of HTTP status codes representing various HTTP response statuses
2///
3/// This enum includes common HTTP status codes that cover successful requests, client errors,
4/// and server errors. Each variant represents a specific HTTP status code.
5///
6/// # Variants
7/// - `Ok`: HTTP 200, indicates that the request was successful and the server has successfully processed it.
8/// - `Created`: HTTP 201, indicates that the request was successful and the server has created a new resource.
9/// - `NoContent`: HTTP 204, indicates that the request was successful but no content is returned.
10/// - `BadRequest`: HTTP 400, indicates that the request is invalid or malformed and the server cannot understand it.
11/// - `Unauthorized`: HTTP 401, indicates that the request is unauthorized and requires authentication.
12/// - `Forbidden`: HTTP 403, indicates that the server understands the request but refuses to authorize it, usually due to insufficient permissions.
13/// - `NotFound`: HTTP 404, indicates that the server cannot find the requested resource.
14/// - `InternalServerError`: HTTP 500, indicates that the server encountered an internal error and cannot process the request.
15/// - `NotImplemented`: HTTP 501, indicates that the server does not support the functionality required to fulfill the request.
16/// - `BadGateway`: HTTP 502, indicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server.
17/// - `Unknown`: Represents an unknown status code, typically used when the status code is not recognized or is undefined.
18/// ```
19#[derive(Debug, Clone, PartialEq, Eq)]
20pub enum StatusCode {
21    /// 200 OK
22    Ok,
23    /// 201 Created
24    Created,
25    /// 204 No Content
26    NoContent,
27    /// 400 Bad Request
28    BadRequest,
29    /// 401 Unauthorized
30    Unauthorized,
31    /// 403 Forbidden
32    Forbidden,
33    /// 404 Not Found
34    NotFound,
35    /// 500 Internal Server Error
36    InternalServerError,
37    /// 501 Not Implemented
38    NotImplemented,
39    /// 502 Bad Gateway
40    BadGateway,
41    /// Unknown status code
42    Unknown,
43}
44
45pub type StatusCodeUsize = usize;