pub enum ApiErrorCode {
NotFound,
Unauthorized,
BadRequest,
Conflict,
VisibilityLocked,
InternalError,
}Expand description
Closed set of error codes the API can emit. Renders as a snake_case
string on the wire (not_found, unauthorized, …) and is declared
as an OpenAPI enum so generated clients can switch on it
exhaustively. Add a variant here, never a free-form string in
the code field of ApiErrorResponse.
JSON schema
{
"description": "Closed set of error codes the API can emit. Renders as a snake_case\nstring on the wire (`not_found`, `unauthorized`, …) and is declared\nas an OpenAPI enum so generated clients can switch on it\nexhaustively. Add a variant here, never a free-form string in\nthe `code` field of `ApiErrorResponse`.",
"type": "string",
"enum": [
"not_found",
"unauthorized",
"bad_request",
"conflict",
"visibility_locked",
"internal_error"
]
}Variants§
Trait Implementations§
Source§impl Clone for ApiErrorCode
impl Clone for ApiErrorCode
Source§fn clone(&self) -> ApiErrorCode
fn clone(&self) -> ApiErrorCode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ApiErrorCode
Source§impl Debug for ApiErrorCode
impl Debug for ApiErrorCode
Source§impl<'de> Deserialize<'de> for ApiErrorCode
impl<'de> Deserialize<'de> for ApiErrorCode
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
Source§impl Display for ApiErrorCode
impl Display for ApiErrorCode
impl Eq for ApiErrorCode
Source§impl FromStr for ApiErrorCode
impl FromStr for ApiErrorCode
Source§impl Hash for ApiErrorCode
impl Hash for ApiErrorCode
Source§impl Ord for ApiErrorCode
impl Ord for ApiErrorCode
Source§fn cmp(&self, other: &ApiErrorCode) -> Ordering
fn cmp(&self, other: &ApiErrorCode) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ApiErrorCode
impl PartialEq for ApiErrorCode
Source§fn eq(&self, other: &ApiErrorCode) -> bool
fn eq(&self, other: &ApiErrorCode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ApiErrorCode
impl PartialOrd for ApiErrorCode
Source§impl Serialize for ApiErrorCode
impl Serialize for ApiErrorCode
impl StructuralPartialEq for ApiErrorCode
Source§impl TryFrom<&String> for ApiErrorCode
impl TryFrom<&String> for ApiErrorCode
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§impl TryFrom<&str> for ApiErrorCode
impl TryFrom<&str> for ApiErrorCode
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§impl TryFrom<String> for ApiErrorCode
impl TryFrom<String> for ApiErrorCode
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for ApiErrorCode
impl RefUnwindSafe for ApiErrorCode
impl Send for ApiErrorCode
impl Sync for ApiErrorCode
impl Unpin for ApiErrorCode
impl UnsafeUnpin for ApiErrorCode
impl UnwindSafe for ApiErrorCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.