Struct Status

Source
pub struct Status {
    pub code: u16,
}

Fields§

§code: u16

Implementations§

Source§

impl Status

Source

pub const Continue: Status

Status with code 100 .

Source

pub const SwitchingProtocols: Status

Status with code 101 .

Source

pub const Processing: Status

Status with code 102 .

Source

pub const Ok: Status

Status with code 200 .

Source

pub const Created: Status

Status with code 201 .

Source

pub const Accepted: Status

Status with code 202 .

Source

pub const NonAuthoritativeInformation: Status

Status with code 203 .

Source

pub const NoContent: Status

Status with code 204 .

Source

pub const ResetContent: Status

Status with code 205 .

Source

pub const PartialContent: Status

Status with code 206 .

Source

pub const MultiStatus: Status

Status with code 207 .

Source

pub const AlreadyReported: Status

Status with code 208 .

Source

pub const ImUsed: Status

Status with code 226 .

Source

pub const MultipleChoices: Status

Status with code 300 .

Source

pub const MovedPermanently: Status

Status with code 301 .

Source

pub const Found: Status

Status with code 302 .

Source

pub const SeeOther: Status

Status with code 303 .

Source

pub const NotModified: Status

Status with code 304 .

Source

pub const UseProxy: Status

Status with code 305 .

Source

pub const TemporaryRedirect: Status

Status with code 307 .

Source

pub const PermanentRedirect: Status

Status with code 308 .

Source

pub const BadRequest: Status

Status with code 400 .

Source

pub const Unauthorized: Status

Status with code 401 .

Source

pub const PaymentRequired: Status

Status with code 402 .

Source

pub const Forbidden: Status

Status with code 403 .

Source

pub const NotFound: Status

Status with code 404 .

Source

pub const MethodNotAllowed: Status

Status with code 405 .

Source

pub const NotAcceptable: Status

Status with code 406 .

Source

pub const ProxyAuthenticationRequired: Status

Status with code 407 .

Source

pub const RequestTimeout: Status

Status with code 408 .

Source

pub const Conflict: Status

Status with code 409 .

Source

pub const Gone: Status

Status with code 410 .

Source

pub const LengthRequired: Status

Status with code 411 .

Source

pub const PreconditionFailed: Status

Status with code 412 .

Source

pub const PayloadTooLarge: Status

Status with code 413 .

Source

pub const UriTooLong: Status

Status with code 414 .

Source

pub const UnsupportedMediaType: Status

Status with code 415 .

Source

pub const RangeNotSatisfiable: Status

Status with code 416 .

Source

pub const ExpectationFailed: Status

Status with code 417 .

Source

pub const ImATeapot: Status

Status with code 418 .

Source

pub const MisdirectedRequest: Status

Status with code 421 .

Source

pub const UnprocessableEntity: Status

Status with code 422 .

Source

pub const Locked: Status

Status with code 423 .

Source

pub const FailedDependency: Status

Status with code 424 .

Source

pub const UpgradeRequired: Status

Status with code 426 .

Source

pub const PreconditionRequired: Status

Status with code 428 .

Source

pub const TooManyRequests: Status

Status with code 429 .

Source

pub const RequestHeaderFieldsTooLarge: Status

Status with code 431 .

Source

pub const UnavailableForLegalReasons: Status

Status with code 451 .

Source

pub const InternalServerError: Status

Status with code 500 .

Source

pub const NotImplemented: Status

Status with code 501 .

Source

pub const BadGateway: Status

Status with code 502 .

Source

pub const ServiceUnavailable: Status

Status with code 503 .

Source

pub const GatewayTimeout: Status

Status with code 504 .

Source

pub const HttpVersionNotSupported: Status

Status with code 505 .

Source

pub const VariantAlsoNegotiates: Status

Status with code 506 .

Source

pub const InsufficientStorage: Status

Status with code 507 .

Source

pub const LoopDetected: Status

Status with code 508 .

Source

pub const NotExtended: Status

Status with code 510 .

Source

pub const NetworkAuthenticationRequired: Status

Status with code 511 .

Source

pub const fn new(code: u16) -> Status

Creates a new Status with code. This should be used only to construct non-standard HTTP statuses. Use an associated constant for standard statuses.

Source

pub const fn from_code(code: u16) -> Option<Status>

Returns a Status given a standard status code code. If code is not a known status code, None is returned.

Source

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

Returns the canonical reason phrase if self corresponds to a canonical, known status code. Otherwise, returns None.

Source

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

Returns the canonical reason phrase if self corresponds to a canonical, known status code, or an unspecified but relevant reason phrase otherwise.

Source

pub const fn is_client_error(&self) -> bool

Trait Implementations§

Source§

impl BorshDeserialize for Status

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
Source§

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
Source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

Source§

impl BorshSerialize for Status

Source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>

Source§

fn try_to_vec(&self) -> Result<Vec<u8>, Error>

Serialize this instance into a vector of bytes.
Source§

impl Clone for Status

Source§

fn clone(&self) -> Status

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

const 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 Default for Status

Source§

fn default() -> Self

Returns the “default value” for a type. 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 Ord for Status

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Status

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const 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 PartialOrd for Status

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for Status

Source§

impl Eq 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.