Enum http_api_problem::HttpStatusCode
[−]
[src]
pub enum HttpStatusCode {
Continue,
SwitchingProtocols,
Processing,
Ok,
Created,
Accepted,
NonAuthoritativeInformation,
NoContent,
ResetContent,
PartialContent,
MultiStatus,
AlreadyReported,
ImUsed,
MultipleChoices,
MovedPermanently,
Found,
SeeOther,
NotModified,
UseProxy,
TemporaryRedirect,
PermanentRedirect,
BadRequest,
Unauthorized,
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,
UnavailableForLegalReasons,
InternalServerError,
NotImplemented,
BadGateway,
ServiceUnavailable,
GatewayTimeout,
HttpVersionNotSupported,
VariantAlsoNegotiates,
InsufficientStorage,
LoopDetected,
NotExtended,
NetworkAuthenticationRequired,
Unregistered(u16),
}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
ContinueSwitchingProtocolsProcessingOkCreatedAcceptedNonAuthoritativeInformationNoContentResetContentPartialContentMultiStatusAlreadyReportedImUsedMultipleChoicesMovedPermanentlyFoundSeeOtherNotModifiedUseProxyTemporaryRedirectPermanentRedirectBadRequestPaymentRequiredForbiddenNotFoundMethodNotAllowedNotAcceptableProxyAuthenticationRequiredRequestTimeoutConflictGoneLengthRequiredPreconditionFailedPayloadTooLargeUriTooLongUnsupportedMediaTypeRangeNotSatisfiableExpectationFailedImATeapotMisdirectedRequestUnprocessableEntityLockedFailedDependencyUpgradeRequiredPreconditionRequiredTooManyRequestsRequestHeaderFieldsTooLargeInternalServerErrorNotImplementedBadGatewayGatewayTimeoutHttpVersionNotSupportedVariantAlsoNegotiatesInsufficientStorageLoopDetectedNotExtendedNetworkAuthenticationRequiredUnregistered(u16)
Methods
impl HttpStatusCode[src]
fn title(&self) -> &'static str[src]
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());
fn to_u16(&self) -> u16[src]
The numeric status code
Example
use http_api_problem::*; assert_eq!(500, HttpStatusCode::InternalServerError.to_u16());
Trait Implementations
impl Debug for HttpStatusCode[src]
impl Clone for HttpStatusCode[src]
fn clone(&self) -> HttpStatusCode[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Copy for HttpStatusCode[src]
impl PartialEq for HttpStatusCode[src]
fn eq(&self, __arg_0: &HttpStatusCode) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &HttpStatusCode) -> bool[src]
This method tests for !=.
impl Eq for HttpStatusCode[src]
impl From<u16> for HttpStatusCode[src]
fn from(n: u16) -> HttpStatusCode[src]
Performs the conversion.