Enum http_api_problem::HttpStatusCode [−][src]
An HTTP status code (status-code
in RFC 7230 et al.).
This enum contains all common status codes and an Unregistered
extension variant. It allows status codes in the range [0, 65535], as any
u16
integer may be used as a status code for XHR requests. It is
recommended to only use values between [100, 599], since only these are
defined as valid status codes with a status class by HTTP.
IANA maintain the Hypertext Transfer Protocol (HTTP) Status Code Registry which is the source for this enum (with one exception, 418 I'm a teapot, which is inexplicably not in the register).
Shamelessly copied from iron.
Variants
Continue
SwitchingProtocols
Processing
Ok
Created
Accepted
NonAuthoritativeInformation
NoContent
ResetContent
PartialContent
MultiStatus
AlreadyReported
ImUsed
MultipleChoices
MovedPermanently
Found
SeeOther
NotModified
UseProxy
TemporaryRedirect
PermanentRedirect
BadRequest
PaymentRequired
Forbidden
NotFound
MethodNotAllowed
NotAcceptable
ProxyAuthenticationRequired
RequestTimeout
Conflict
Gone
LengthRequired
PreconditionFailed
PayloadTooLarge
UriTooLong
UnsupportedMediaType
RangeNotSatisfiable
ExpectationFailed
ImATeapot
MisdirectedRequest
UnprocessableEntity
Locked
FailedDependency
UpgradeRequired
PreconditionRequired
TooManyRequests
RequestHeaderFieldsTooLarge
InternalServerError
NotImplemented
BadGateway
GatewayTimeout
HttpVersionNotSupported
VariantAlsoNegotiates
InsufficientStorage
LoopDetected
NotExtended
NetworkAuthenticationRequired
Unregistered(u16)
Methods
impl HttpStatusCode
[src]
[−]
impl HttpStatusCode
pub fn is_informational(&self) -> bool
[src]
[−]
pub fn is_informational(&self) -> bool
HttpStatusCode
is within 100-199.
pub fn is_success(&self) -> bool
[src]
[−]
pub fn is_success(&self) -> bool
HttpStatusCode
is within 200-299.
pub fn is_redirection(&self) -> bool
[src]
[−]
pub fn is_redirection(&self) -> bool
HttpStatusCode
is within 300-399.
pub fn is_client_error(&self) -> bool
[src]
[−]
pub fn is_client_error(&self) -> bool
HttpStatusCode
is within 400-499.
pub fn is_server_error(&self) -> bool
[src]
[−]
pub fn is_server_error(&self) -> bool
HttpStatusCode
is within 500-599.
pub fn title(&self) -> &'static str
[src]
[−]
pub fn title(&self) -> &'static str
A descriptive title for the status code which does not contain the numeric code itself.
#Example
use http_api_problem::*; assert_eq!("Internal Server Error", HttpStatusCode::InternalServerError.title());
pub fn to_u16(&self) -> u16
[src]
[−]
pub fn to_u16(&self) -> u16
The numeric status code
#Example
use http_api_problem::*; assert_eq!(500, HttpStatusCode::InternalServerError.to_u16());
Trait Implementations
impl From<HttpStatusCode> for HttpApiProblem
[src]
[+]
impl From<HttpStatusCode> for HttpApiProblem
impl Debug for HttpStatusCode
[src]
[+]
impl Debug for HttpStatusCode
impl Clone for HttpStatusCode
[src]
[+]
impl Clone for HttpStatusCode
impl Copy for HttpStatusCode
[src]
impl Copy for HttpStatusCode
impl PartialEq for HttpStatusCode
[src]
[+]
impl PartialEq for HttpStatusCode
impl Eq for HttpStatusCode
[src]
impl Eq for HttpStatusCode
impl From<u16> for HttpStatusCode
[src]
[+]
impl From<u16> for HttpStatusCode
impl Display for HttpStatusCode
[src]
[+]
impl Display for HttpStatusCode
impl Serialize for HttpStatusCode
[src]
[+]
impl Serialize for HttpStatusCode
impl<'de> Deserialize<'de> for HttpStatusCode
[src]
[+]
impl<'de> Deserialize<'de> for HttpStatusCode
Auto Trait Implementations
impl Send for HttpStatusCode
impl Send for HttpStatusCode
impl Sync for HttpStatusCode
impl Sync for HttpStatusCode