Status

Enum Status 

Source
pub enum Status {
Show 60 variants 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,
}
Expand description

Http status code variants

Variants§

§

Continue

100 Continue [RFC7231, Section 6.2.1]

§

SwitchingProtocols

101 Switching Protocols [RFC7231, Section 6.2.2]

§

Processing

102 Processing [RFC2518]

§

Ok

§

Created

201 Created [RFC7231, Section 6.3.2]

§

Accepted

202 Accepted [RFC7231, Section 6.3.3]

§

NonAuthoritativeInformation

203 Non-Authoritative Information [RFC7231, Section 6.3.4]

§

NoContent

204 No Content [RFC7231, Section 6.3.5]

§

ResetContent

205 Reset Content [RFC7231, Section 6.3.6]

§

PartialContent

206 Partial Content [RFC7233, Section 4.1]

§

MultiStatus

207 Multi-Status [RFC4918]

§

AlreadyReported

208 Already Reported [RFC5842]

§

ImUsed

226 IM Used [RFC3229]

§

MultipleChoices

300 Multiple Choices [RFC7231, Section 6.4.1]

§

MovedPermanently

301 Moved Permanently [RFC7231, Section 6.4.2]

§

Found

§

SeeOther

303 See Other [RFC7231, Section 6.4.4]

§

NotModified

304 Not Modified [RFC7232, Section 4.1]

§

UseProxy

305 Use Proxy [RFC7231, Section 6.4.5]

§

TemporaryRedirect

307 Temporary Redirect [RFC7231, Section 6.4.7]

§

PermanentRedirect

308 Permanent Redirect [RFC7238]

§

BadRequest

400 Bad Request [RFC7231, Section 6.5.1]

§

Unauthorized

401 Unauthorized [RFC7235, Section 3.1]

§

PaymentRequired

402 Payment Required [RFC7231, Section 6.5.2]

§

Forbidden

403 Forbidden [RFC7231, Section 6.5.3]

§

NotFound

404 Not Found [RFC7231, Section 6.5.4]

§

MethodNotAllowed

405 Method Not Allowed [RFC7231, Section 6.5.5]

§

NotAcceptable

406 Not Acceptable [RFC7231, Section 6.5.6]

§

ProxyAuthenticationRequired

407 Proxy Authentication Required [RFC7235, Section 3.2]

§

RequestTimeout

408 Request Timeout [RFC7231, Section 6.5.7]

§

Conflict

409 Conflict [RFC7231, Section 6.5.8]

§

Gone

§

LengthRequired

411 Length Required [RFC7231, Section 6.5.10]

§

PreconditionFailed

412 Precondition Failed [RFC7232, Section 4.2]

§

PayloadTooLarge

413 Payload Too Large [RFC7231, Section 6.5.11]

§

UriTooLong

414 URI Too Long [RFC7231, Section 6.5.12]

§

UnsupportedMediaType

415 Unsupported Media Type [RFC7231, Section 6.5.13]

§

RangeNotSatisfiable

416 Range Not Satisfiable [RFC7233, Section 4.4]

§

ExpectationFailed

417 Expectation Failed [RFC7231, Section 6.5.14]

§

ImATeapot

418 I’m a teapot [curiously not registered by IANA but RFC2324]

§

MisdirectedRequest

421 Misdirected Request RFC7540, Section 9.1.2

§

UnprocessableEntity

422 Unprocessable Entity [RFC4918]

§

Locked

423 Locked [RFC4918]

§

FailedDependency

424 Failed Dependency [RFC4918]

§

UpgradeRequired

426 Upgrade Required [RFC7231, Section 6.5.15]

§

PreconditionRequired

428 Precondition Required [RFC6585]

§

TooManyRequests

429 Too Many Requests [RFC6585]

§

RequestHeaderFieldsTooLarge

431 Request Header Fields Too Large [RFC6585]

§

UnavailableForLegalReasons

451 Unavailable For Legal Reasons [RFC7725]

§

InternalServerError

500 Internal Server Error [RFC7231, Section 6.6.1]

§

NotImplemented

501 Not Implemented [RFC7231, Section 6.6.2]

§

BadGateway

502 Bad Gateway [RFC7231, Section 6.6.3]

§

ServiceUnavailable

503 Service Unavailable [RFC7231, Section 6.6.4]

§

GatewayTimeout

504 Gateway Timeout [RFC7231, Section 6.6.5]

§

HttpVersionNotSupported

505 HTTP Version Not Supported [RFC7231, Section 6.6.6]

§

VariantAlsoNegotiates

506 Variant Also Negotiates [RFC2295]

§

InsufficientStorage

507 Insufficient Storage [RFC4918]

§

LoopDetected

508 Loop Detected [RFC5842]

§

NotExtended

510 Not Extended [RFC2774]

§

NetworkAuthenticationRequired

511 Network Authentication Required [RFC6585]

Implementations§

Source§

impl Status

Source

pub fn code(&self) -> u16

Returns the status code

Source

pub fn reason(&self) -> &'static str

Returns the status reason

Source§

impl Status

Source

pub fn is_informational(&self) -> bool

Check if status is within 100-199.

Source

pub fn is_success(&self) -> bool

Check if status is within 200-299.

Source

pub fn is_redirection(&self) -> bool

Check if status is within 300-399.

Source

pub fn is_client_error(&self) -> bool

Check if status is within 400-499.

Source

pub fn is_server_error(&self) -> bool

Check if status is within 500-599.

Trait Implementations§

Source§

impl Clone for Status

Source§

fn clone(&self) -> Status

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Status

Source§

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

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

impl Display for Status

Source§

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

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

impl Hash for Status

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 Status

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Copy for Status

Source§

impl Eq for Status

Source§

impl StructuralPartialEq for Status

Auto Trait Implementations§

§

impl Freeze for Status

§

impl RefUnwindSafe for Status

§

impl Send for Status

§

impl Sync for Status

§

impl Unpin for Status

§

impl UnwindSafe for Status

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.