pub enum Code {
Show 18 variants
Internal,
BadRequest,
NotFound,
MethodNotAllowed,
Gone,
Conflict,
PayloadTooLarge,
RequestTimeout,
RateLimited,
Unavailable,
ValidationFailed,
Unauthorized,
Forbidden,
UnprocessableEntity,
Timeout,
Canceled,
DownstreamError,
DownstreamTimeout,
}Expand description
Machine-readable error codes that remain stable across releases.
Variants§
Internal
BadRequest
NotFound
MethodNotAllowed
Gone
Conflict
PayloadTooLarge
RequestTimeout
RateLimited
ValidationFailed
Forbidden
UnprocessableEntity
Timeout
Canceled
DownstreamError
DownstreamTimeout
Implementations§
Source§impl Code
impl Code
Sourcepub fn default_status(&self) -> u16
pub fn default_status(&self) -> u16
Returns the default HTTP status code for this error code.
Sourcepub fn is_retryable_default(&self) -> bool
pub fn is_retryable_default(&self) -> bool
Returns whether this error is retryable by default.
Sourcepub fn default_message(&self) -> &'static str
pub fn default_message(&self) -> &'static str
Returns a default human-readable message for this code.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Code
impl<'de> Deserialize<'de> for Code
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Code
impl Eq for Code
impl StructuralPartialEq for Code
Auto Trait Implementations§
impl Freeze for Code
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnwindSafe for Code
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more