[][src]Enum httpstatus::StatusCode

pub enum StatusCode {
    Continue,
    SwitchingProtocols,
    Processing,
    EarlyHints,
    Ok,
    Created,
    Accepted,
    NonAuthoritativeInformation,
    NoContent,
    ResetContent,
    PartialContent,
    MultiStatus,
    AlreadyReported,
    IMUsed,
    MultipleChoices,
    MovedPermanently,
    Found,
    SeeOther,
    NotModified,
    UseProxy,
    SwitchProxy,
    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,
    Unknown(u16),
}

Represents an HTTP status code

Variants

Continue

100 Continue (RFC 7231)

SwitchingProtocols

101 Switching Protocols (RFC 7231)

Processing

102 Processing (RFC 2518)

EarlyHints

103 Early Hints (RFC 8297)

Ok

200 OK (RFC 7231)

Created

201 Created (RFC 7231)

Accepted

202 Accepted (RFC 7231)

NonAuthoritativeInformation

203 Non-Authoritative Information (RFC 7231)

NoContent

204 No Content (RFC 7231)

ResetContent

205 Reset Content (RFC 7231)

PartialContent

206 Partial Content (RFC 7233)

MultiStatus

207 Multi-Status (RFC 4918)

AlreadyReported

208 Already Reported (RFC 5842)

IMUsed

226 IM Used (RFC 3229)

MultipleChoices

300 Multiple Choices (RFC 7231)

MovedPermanently

301 Moved Permanently (RFC 7231)

Found

302 Found (RFC 7231)

SeeOther

303 See Other (RFC 7231)

NotModified

304 Not Modified (RFC 7232)

UseProxy

305 Use Proxy (RFC 7231)

SwitchProxy

306 Switch Proxy (RFC 7231)

TemporaryRedirect

307 Temporary Redirect (RFC 7231)

PermanentRedirect

308 Permanent Redirect (RFC 7538)

BadRequest

400 Bad Request (RFC 7231)

Unauthorized

401 Unauthorized (RFC 7235)

PaymentRequired

402 Payment Required (RFC 7231)

Forbidden

403 Forbidden (RFC 7231)

NotFound

404 Not Found (RFC 7231)

MethodNotAllowed

405 Method Not Allowed (RFC 7231)

NotAcceptable

406 Not Acceptable (RFC 7231)

ProxyAuthenticationRequired

407 Proxy Authentication Required (RFC 7235)

RequestTimeout

408 Request Timeout (RFC 7231)

Conflict

409 Conflict (RFC 7231)

Gone

410 Gone (RFC 7231)

LengthRequired

411 Length Required (RFC 7231)

PreconditionFailed

412 Precondition Failed (RFC 7232)

PayloadTooLarge

413 Payload Too Large (RFC 7231)

UriTooLong

414 URI Too Long (RFC 7231)

UnsupportedMediaType

415 Unsupported Media Type (RFC 7231)

RangeNotSatisfiable

416 Range Not Satisfiable (RFC 7233)

ExpectationFailed

417 Expectation Failed (RFC 7231)

ImATeapot

418 I'm a teapot (RFC 2324)

MisdirectedRequest

421 Misdirected Request (RFC 7540)

UnprocessableEntity

422 Unprocessable Entity (RFC 4918)

Locked

423 Locked (RFC 4918)

FailedDependency

424 Failed Dependency (RFC 4918)

UpgradeRequired

426 Upgrade Required (RFC 7231)

PreconditionRequired

428 Precondition Required (RFC 6585)

TooManyRequests

429 Too Many Requests (RFC 6585)

RequestHeaderFieldsTooLarge

431 Request Header Fields Too Large (RFC 6585)

UnavailableForLegalReasons

451 Unavailable For Legal Reasons (RFC 7725)

InternalServerError

500 Internal Server Error (RFC 7231)

NotImplemented

501 Not Implemented (RFC 7231)

BadGateway

502 Bad Gateway (RFC 7231)

ServiceUnavailable

503 Service Unavailable (RFC 7231)

GatewayTimeout

504 Gateway Timeout (RFC 7231)

HttpVersionNotSupported

505 HTTP Version Not Supported (RFC 7231)

VariantAlsoNegotiates

506 Variant Also Negotiates (RFC 2295)

InsufficientStorage

507 Insufficient Storage (RFC 4918)

LoopDetected

508 Loop Detected (RFC 5842)

NotExtended

510 Not Extended (RFC 2774)

NetworkAuthenticationRequired

511 Network Authentication Required (RFC 6585)

Unknown(u16)

Unknown status code

Implementations

impl StatusCode[src]

pub fn as_u16(&self) -> u16[src]

Returns the numeric status code

pub fn reason_phrase(&self) -> &'static str[src]

Returns the reason phrase of HTTP status code

pub fn class(&self) -> StatusClass[src]

Returns the status class of status code

Trait Implementations

impl Clone for StatusCode[src]

impl Debug for StatusCode[src]

impl<'de> Deserialize<'de> for StatusCode[src]

impl Display for StatusCode[src]

impl Eq for StatusCode[src]

impl From<u16> for StatusCode[src]

impl Hash for StatusCode[src]

impl Ord for StatusCode[src]

impl PartialEq<StatusCode> for StatusCode[src]

impl PartialOrd<StatusCode> for StatusCode[src]

impl Serialize for StatusCode[src]

impl StructuralEq for StatusCode[src]

impl StructuralPartialEq for StatusCode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.