Skip to main content

StatusCode

Enum StatusCode 

Source
#[repr(u16)]
pub enum StatusCode {
Show 62 variants Continue = 100, SwitchingProtocols = 101, Processing = 102, EarlyHints = 103, Ok = 200, Created = 201, Accepted = 202, NonAuthoritativeInformation = 203, NoContent = 204, ResetContent = 205, PartialContent = 206, MultiStatus = 207, AlreadyReported = 208, ImUsed = 226, MultipleChoices = 300, MovedPermanently = 301, Found = 302, SeeOther = 303, NotModified = 304, UseProxy = 305, TemporaryRedirect = 307, PermanentRedirect = 308, BadRequest = 400, Unauthorized = 401, PaymentRequired = 402, Forbidden = 403, NotFound = 404, MethodNotAllowed = 405, NotAcceptable = 406, ProxyAuthenticationRequired = 407, RequestTimeout = 408, Conflict = 409, Gone = 410, LengthRequired = 411, PreconditionFailed = 412, PayloadTooLarge = 413, UriTooLong = 414, UnsupportedMediaType = 415, RangeNotSatisfiable = 416, ExpectationFailed = 417, ImATeapot = 418, MisdirectedRequest = 421, UnprocessableEntity = 422, Locked = 423, FailedDependency = 424, TooEarly = 425, UpgradeRequired = 426, PreconditionRequired = 428, TooManyRequests = 429, RequestHeaderFieldsTooLarge = 431, UnavailableForLegalReasons = 451, InternalServerError = 500, NotImplemented = 501, BadGateway = 502, ServiceUnavailable = 503, GatewayTimeout = 504, HttpVersionNotSupported = 505, VariantAlsoNegotiates = 506, InsufficientStorage = 507, LoopDetected = 508, NotExtended = 510, NetworkAuthenticationRequired = 511,
}
Expand description

HTTP status codes defined by RFC 9110 and related specifications.

Variants§

§

Continue = 100

Continue

§

SwitchingProtocols = 101

Switching Protocols

§

Processing = 102

Processing

§

EarlyHints = 103

Early Hints

§

Ok = 200

OK

§

Created = 201

Created

§

Accepted = 202

Accepted

§

NonAuthoritativeInformation = 203

Non-Authoritative Information

§

NoContent = 204

No Content

§

ResetContent = 205

Reset Content

§

PartialContent = 206

Partial Content

§

MultiStatus = 207

Multi-Status

§

AlreadyReported = 208

Already Reported

§

ImUsed = 226

IM Used

§

MultipleChoices = 300

Multiple Choices

§

MovedPermanently = 301

Moved Permanently

§

Found = 302

Found

§

SeeOther = 303

See Other

§

NotModified = 304

Not Modified

§

UseProxy = 305

Use Proxy

§

TemporaryRedirect = 307

Temporary Redirect

§

PermanentRedirect = 308

Permanent Redirect

§

BadRequest = 400

Bad Request

§

Unauthorized = 401

Unauthorized

§

PaymentRequired = 402

Payment Required

§

Forbidden = 403

Forbidden

§

NotFound = 404

Not Found

§

MethodNotAllowed = 405

Method Not Allowed

§

NotAcceptable = 406

Not Acceptable

§

ProxyAuthenticationRequired = 407

Proxy Authentication Required

§

RequestTimeout = 408

Request Timeout

§

Conflict = 409

Conflict

§

Gone = 410

Gone

§

LengthRequired = 411

Length Required

§

PreconditionFailed = 412

Precondition Failed

§

PayloadTooLarge = 413

Content Too Large

§

UriTooLong = 414

URI Too Long

§

UnsupportedMediaType = 415

Unsupported Media Type

§

RangeNotSatisfiable = 416

Range Not Satisfiable

§

ExpectationFailed = 417

Expectation Failed

§

ImATeapot = 418

I’m a teapot

§

MisdirectedRequest = 421

Misdirected Request

§

UnprocessableEntity = 422

Unprocessable Content

§

Locked = 423

Locked

§

FailedDependency = 424

Failed Dependency

§

TooEarly = 425

Too Early

§

UpgradeRequired = 426

Upgrade Required

§

PreconditionRequired = 428

Precondition Required

§

TooManyRequests = 429

Too Many Requests

§

RequestHeaderFieldsTooLarge = 431

Request Header Fields Too Large

§

UnavailableForLegalReasons = 451

Unavailable For Legal Reasons

§

InternalServerError = 500

Internal Server Error

§

NotImplemented = 501

Not Implemented

§

BadGateway = 502

Bad Gateway

§

ServiceUnavailable = 503

Service Unavailable

§

GatewayTimeout = 504

Gateway Timeout

§

HttpVersionNotSupported = 505

HTTP Version Not Supported

§

VariantAlsoNegotiates = 506

Variant Also Negotiates

§

InsufficientStorage = 507

Insufficient Storage

§

LoopDetected = 508

Loop Detected

§

NotExtended = 510

Not Extended

§

NetworkAuthenticationRequired = 511

Network Authentication Required

Implementations§

Source§

impl StatusCode

Source

pub const CONTINUE: StatusCode = StatusCode::Continue

Alias matching reqwest’s naming style.

Source

pub const SWITCHING_PROTOCOLS: StatusCode = StatusCode::SwitchingProtocols

Alias matching reqwest’s naming style.

Source

pub const PROCESSING: StatusCode = StatusCode::Processing

Alias matching reqwest’s naming style.

Source

pub const EARLY_HINTS: StatusCode = StatusCode::EarlyHints

Alias matching reqwest’s naming style.

Source

pub const OK: StatusCode = StatusCode::Ok

Alias matching reqwest’s naming style.

Source

pub const CREATED: StatusCode = StatusCode::Created

Alias matching reqwest’s naming style.

Source

pub const ACCEPTED: StatusCode = StatusCode::Accepted

Alias matching reqwest’s naming style.

Source

pub const NON_AUTHORITATIVE_INFORMATION: StatusCode = StatusCode::NonAuthoritativeInformation

Alias matching reqwest’s naming style.

Source

pub const NO_CONTENT: StatusCode = StatusCode::NoContent

Alias matching reqwest’s naming style.

Source

pub const RESET_CONTENT: StatusCode = StatusCode::ResetContent

Alias matching reqwest’s naming style.

Source

pub const PARTIAL_CONTENT: StatusCode = StatusCode::PartialContent

Alias matching reqwest’s naming style.

Source

pub const MULTI_STATUS: StatusCode = StatusCode::MultiStatus

Alias matching reqwest’s naming style.

Source

pub const ALREADY_REPORTED: StatusCode = StatusCode::AlreadyReported

Alias matching reqwest’s naming style.

Source

pub const IM_USED: StatusCode = StatusCode::ImUsed

Alias matching reqwest’s naming style.

Source

pub const MULTIPLE_CHOICES: StatusCode = StatusCode::MultipleChoices

Alias matching reqwest’s naming style.

Source

pub const MOVED_PERMANENTLY: StatusCode = StatusCode::MovedPermanently

Alias matching reqwest’s naming style.

Source

pub const FOUND: StatusCode = StatusCode::Found

Alias matching reqwest’s naming style.

Source

pub const SEE_OTHER: StatusCode = StatusCode::SeeOther

Alias matching reqwest’s naming style.

Source

pub const NOT_MODIFIED: StatusCode = StatusCode::NotModified

Alias matching reqwest’s naming style.

Source

pub const USE_PROXY: StatusCode = StatusCode::UseProxy

Alias matching reqwest’s naming style.

Source

pub const TEMPORARY_REDIRECT: StatusCode = StatusCode::TemporaryRedirect

Alias matching reqwest’s naming style.

Source

pub const PERMANENT_REDIRECT: StatusCode = StatusCode::PermanentRedirect

Alias matching reqwest’s naming style.

Source

pub const BAD_REQUEST: StatusCode = StatusCode::BadRequest

Alias matching reqwest’s naming style.

Source

pub const UNAUTHORIZED: StatusCode = StatusCode::Unauthorized

Alias matching reqwest’s naming style.

Source

pub const PAYMENT_REQUIRED: StatusCode = StatusCode::PaymentRequired

Alias matching reqwest’s naming style.

Source

pub const FORBIDDEN: StatusCode = StatusCode::Forbidden

Alias matching reqwest’s naming style.

Source

pub const NOT_FOUND: StatusCode = StatusCode::NotFound

Alias matching reqwest’s naming style.

Source

pub const METHOD_NOT_ALLOWED: StatusCode = StatusCode::MethodNotAllowed

Alias matching reqwest’s naming style.

Source

pub const NOT_ACCEPTABLE: StatusCode = StatusCode::NotAcceptable

Alias matching reqwest’s naming style.

Source

pub const PROXY_AUTHENTICATION_REQUIRED: StatusCode = StatusCode::ProxyAuthenticationRequired

Alias matching reqwest’s naming style.

Source

pub const REQUEST_TIMEOUT: StatusCode = StatusCode::RequestTimeout

Alias matching reqwest’s naming style.

Source

pub const CONFLICT: StatusCode = StatusCode::Conflict

Alias matching reqwest’s naming style.

Source

pub const GONE: StatusCode = StatusCode::Gone

Alias matching reqwest’s naming style.

Source

pub const LENGTH_REQUIRED: StatusCode = StatusCode::LengthRequired

Alias matching reqwest’s naming style.

Source

pub const PRECONDITION_FAILED: StatusCode = StatusCode::PreconditionFailed

Alias matching reqwest’s naming style.

Source

pub const PAYLOAD_TOO_LARGE: StatusCode = StatusCode::PayloadTooLarge

Alias matching reqwest’s naming style.

Source

pub const URI_TOO_LONG: StatusCode = StatusCode::UriTooLong

Alias matching reqwest’s naming style.

Source

pub const UNSUPPORTED_MEDIA_TYPE: StatusCode = StatusCode::UnsupportedMediaType

Alias matching reqwest’s naming style.

Source

pub const RANGE_NOT_SATISFIABLE: StatusCode = StatusCode::RangeNotSatisfiable

Alias matching reqwest’s naming style.

Source

pub const EXPECTATION_FAILED: StatusCode = StatusCode::ExpectationFailed

Alias matching reqwest’s naming style.

Source

pub const IM_A_TEAPOT: StatusCode = StatusCode::ImATeapot

Alias matching reqwest’s naming style.

Source

pub const MISDIRECTED_REQUEST: StatusCode = StatusCode::MisdirectedRequest

Alias matching reqwest’s naming style.

Source

pub const UNPROCESSABLE_ENTITY: StatusCode = StatusCode::UnprocessableEntity

Alias matching reqwest’s naming style.

Source

pub const LOCKED: StatusCode = StatusCode::Locked

Alias matching reqwest’s naming style.

Source

pub const FAILED_DEPENDENCY: StatusCode = StatusCode::FailedDependency

Alias matching reqwest’s naming style.

Source

pub const TOO_EARLY: StatusCode = StatusCode::TooEarly

Alias matching reqwest’s naming style.

Source

pub const UPGRADE_REQUIRED: StatusCode = StatusCode::UpgradeRequired

Alias matching reqwest’s naming style.

Source

pub const PRECONDITION_REQUIRED: StatusCode = StatusCode::PreconditionRequired

Alias matching reqwest’s naming style.

Source

pub const TOO_MANY_REQUESTS: StatusCode = StatusCode::TooManyRequests

Alias matching reqwest’s naming style.

Source

pub const REQUEST_HEADER_FIELDS_TOO_LARGE: StatusCode = StatusCode::RequestHeaderFieldsTooLarge

Alias matching reqwest’s naming style.

Alias matching reqwest’s naming style.

Source

pub const INTERNAL_SERVER_ERROR: StatusCode = StatusCode::InternalServerError

Alias matching reqwest’s naming style.

Source

pub const NOT_IMPLEMENTED: StatusCode = StatusCode::NotImplemented

Alias matching reqwest’s naming style.

Source

pub const BAD_GATEWAY: StatusCode = StatusCode::BadGateway

Alias matching reqwest’s naming style.

Source

pub const SERVICE_UNAVAILABLE: StatusCode = StatusCode::ServiceUnavailable

Alias matching reqwest’s naming style.

Source

pub const GATEWAY_TIMEOUT: StatusCode = StatusCode::GatewayTimeout

Alias matching reqwest’s naming style.

Source

pub const HTTP_VERSION_NOT_SUPPORTED: StatusCode = StatusCode::HttpVersionNotSupported

Alias matching reqwest’s naming style.

Source

pub const VARIANT_ALSO_NEGOTIATES: StatusCode = StatusCode::VariantAlsoNegotiates

Alias matching reqwest’s naming style.

Source

pub const INSUFFICIENT_STORAGE: StatusCode = StatusCode::InsufficientStorage

Alias matching reqwest’s naming style.

Source

pub const LOOP_DETECTED: StatusCode = StatusCode::LoopDetected

Alias matching reqwest’s naming style.

Source

pub const NOT_EXTENDED: StatusCode = StatusCode::NotExtended

Alias matching reqwest’s naming style.

Source

pub const NETWORK_AUTHENTICATION_REQUIRED: StatusCode = StatusCode::NetworkAuthenticationRequired

Alias matching reqwest’s naming style.

Source

pub const fn as_u16(self) -> u16

Returns the numeric status code.

Source

pub const fn canonical_reason(self) -> &'static str

Returns the canonical reason phrase for this status code.

Source

pub const fn from_u16(code: u16) -> Option<Self>

Converts a numeric status code into a StatusCode if known.

Trait Implementations§

Source§

impl Clone for StatusCode

Source§

fn clone(&self) -> StatusCode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StatusCode

Source§

impl Debug for StatusCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StatusCode

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for StatusCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for StatusCode

Source§

impl Hash for StatusCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for StatusCode

Source§

fn eq(&self, other: &StatusCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for StatusCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.