Skip to main content

ErrorCode

Struct ErrorCode 

Source
pub struct ErrorCode { /* private fields */ }
Expand description

ErrorCode is a wrapper around u32 that represents an error code.

Implementations§

Source§

impl ErrorCode

Source

pub const BAD_REQUEST: Self

Indicated a bad request.

Source

pub const UNAUTHORIZED: Self

Indicates that authentication is required.

Source

pub const PAYMENT_REQUIRED: Self

Indicates that payment is required.

Source

pub const FORBIDDEN: Self

Indicates forbidden access.

Source

pub const NOT_FOUND: Self

Indicates that the requested resource was not found.

Source

pub const METHOD_NOT_ALLOWED: Self

Indicates that the request method is not allowed.

Source

pub const NOT_ACCEPTABLE: Self

Indicates that the requested response format is not acceptable.

Source

pub const PROXY_AUTHENTICATION_REQUIRED: Self

Indicates that proxy authentication is required.

Source

pub const REQUEST_TIMEOUT: Self

Indicates that the request timed out.

Source

pub const CONFLICT: Self

Indicates that the request conflicts with current state.

Source

pub const GONE: Self

Indicates that the requested resource is gone.

Source

pub const LENGTH_REQUIRED: Self

Indicates that the request must include a content length.

Source

pub const PRECONDITION_FAILED: Self

Indicates that a precondition failed.

Source

pub const PAYLOAD_TOO_LARGE: Self

Indicates that the payload is too large.

Source

pub const URI_TOO_LONG: Self

Indicates that the URI is too long.

Source

pub const UNSUPPORTED_MEDIA_TYPE: Self

Indicates that the media type is unsupported.

Source

pub const RANGE_NOT_SATISFIABLE: Self

Indicates that the requested range cannot be satisfied.

Source

pub const EXPECTATION_FAILED: Self

Indicates that an expectation failed.

Source

pub const IM_A_TEAPOT: Self

Indicates an I’m a teapot response.

Source

pub const MISDIRECTED_REQUEST: Self

Indicates that the request was misdirected.

Source

pub const UNPROCESSABLE_ENTITY: Self

Indicates that the entity could not be processed.

Source

pub const LOCKED: Self

Indicates that the resource is locked.

Source

pub const FAILED_DEPENDENCY: Self

Indicates a failed dependency.

Source

pub const UPGRADE_REQUIRED: Self

Indicates that the request must be upgraded.

Source

pub const PRECONDITION_REQUIRED: Self

Indicates that a precondition is required.

Source

pub const TOO_MANY_REQUESTS: Self

Indicates too many requests.

Source

pub const REQUEST_HEADER_FIELDS_TOO_LARGE: Self

Indicates that request header fields are too large.

Indicates that the request is unavailable for legal reasons.

Source

pub const INTERNAL_ERROR: Self

Indicates an internal server error.

Source

pub const NOT_IMPLEMENTED: Self

Indicates a non-implemented endpoint.

Source

pub const BAD_GATEWAY: Self

Indicates a bad gateway.

Source

pub const SERVICE_UNAVAILABLE: Self

Indicates that the service is unavailable.

Source

pub const GATEWAY_TIMEOUT: Self

Indicates a gateway timeout.

Source

pub const HTTP_VERSION_NOT_SUPPORTED: Self

Indicates that the HTTP version is not supported.

Source

pub const VARIANT_ALSO_NEGOTIATES: Self

Indicates that content negotiation also found a variant problem.

Source

pub const INSUFFICIENT_STORAGE: Self

Indicates insufficient storage.

Source

pub const LOOP_DETECTED: Self

Indicates that a loop was detected.

Source

pub const NOT_EXTENDED: Self

Indicates that the request must be extended.

Source

pub const NETWORK_AUTHENTICATION_REQUIRED: Self

Indicates that network authentication is required.

Source

pub const fn new(code: u32) -> Self

Create a new ErrorCode from a u32.

Source

pub const fn to_u32(self) -> u32

Get the ErrorCode as a u32. Just returns the code field.

Source

pub const fn code(self) -> u32

Getter for the ErrorCode code field.

Source

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

Source

pub fn from_name(name: &str) -> Option<Self>

Trait Implementations§

Source§

impl Clone for ErrorCode

Source§

fn clone(&self) -> ErrorCode

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 ErrorCode

Source§

impl Debug for ErrorCode

Source§

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

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

impl<'de> Deserialize<'de> for ErrorCode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ErrorCode

Source§

impl FromStr for ErrorCode

Source§

type Err = ParseErrorCodeError

The associated error which can be returned from parsing.
Source§

fn from_str(value: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for ErrorCode

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 ErrorCode

Source§

fn eq(&self, other: &ErrorCode) -> 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 Serialize for ErrorCode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ErrorCode

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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, 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more