#[non_exhaustive]#[repr(i32)]pub enum ErrorCode {
Show 16 variants
CANCELLED = 10,
UNKNOWN = 11,
INVALID_ARGUMENT = 12,
DEADLINE_EXCEEDED = 13,
NOT_FOUND = 14,
ALREADY_EXISTS = 15,
PERMISSION_DENIED = 16,
RESOURCE_EXHAUSTED = 17,
FAILED_PRECONDITION = 18,
ABORTED = 19,
OUT_OF_RANGE = 20,
UNIMPLEMENTED = 21,
INTERNAL = 22,
UNAVAILABLE = 23,
DATA_LOSS = 24,
UNAUTHENTICATED = 25,
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
CANCELLED = 10
UNKNOWN = 11
INVALID_ARGUMENT = 12
DEADLINE_EXCEEDED = 13
NOT_FOUND = 14
ALREADY_EXISTS = 15
PERMISSION_DENIED = 16
RESOURCE_EXHAUSTED = 17
FAILED_PRECONDITION = 18
ABORTED = 19
OUT_OF_RANGE = 20
UNIMPLEMENTED = 21
INTERNAL = 22
UNAVAILABLE = 23
DATA_LOSS = 24
UNAUTHENTICATED = 25
Implementations§
Source§impl ErrorCode
impl ErrorCode
pub fn maybe_client_error(self) -> bool
Sourcepub fn api_error0(self, message: impl Into<MaybeString>) -> ApiError
pub fn api_error0(self, message: impl Into<MaybeString>) -> ApiError
Generate an ApiError without code segment suffix.
Sourcepub fn api_error1(
self,
s1: CodeSegment,
message: impl Into<MaybeString>,
) -> ApiError
pub fn api_error1( self, s1: CodeSegment, message: impl Into<MaybeString>, ) -> ApiError
Generate an ApiError, and append 2*1 digits at the end of the current code in the form of a decimal literal.
Sourcepub fn api_error2(
self,
s1: CodeSegment,
s2: CodeSegment,
message: impl Into<MaybeString>,
) -> ApiError
pub fn api_error2( self, s1: CodeSegment, s2: CodeSegment, message: impl Into<MaybeString>, ) -> ApiError
Generate an ApiError, and append 2*2 digits at the end of the current code in the form of a decimal literal.
Sourcepub fn api_error3(
self,
s1: CodeSegment,
s2: CodeSegment,
s3: CodeSegment,
message: impl Into<MaybeString>,
) -> ApiError
pub fn api_error3( self, s1: CodeSegment, s2: CodeSegment, s3: CodeSegment, message: impl Into<MaybeString>, ) -> ApiError
Generate an ApiError, and append 2*3 digits at the end of the current code in the form of a decimal literal.
Trait Implementations§
Source§impl BitOr<CodeSegment> for ErrorCode
impl BitOr<CodeSegment> for ErrorCode
Append two digits at the end in the form of a decimal literal.
Source§impl From<ErrorCode> for StatusCode
impl From<ErrorCode> for StatusCode
Source§impl From<StatusCode> for ErrorCode
impl From<StatusCode> for ErrorCode
Source§fn from(value: StatusCode) -> Self
fn from(value: StatusCode) -> Self
Converts to this type from the input type.
Source§impl TryFromPrimitive for ErrorCode
impl TryFromPrimitive for ErrorCode
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<Data> ApiSuccessResponse for Data
impl<Data> ApiSuccessResponse for Data
fn api_response<Meta>(self, meta: Option<Meta>) -> ApiResponse<Self, Meta>
fn api_response_without_meta<Meta>(self) -> ApiResponse<Self, Meta>
fn api_response_with_meta<Meta>(self, meta: Meta) -> ApiResponse<Self, Meta>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)