api_response::error_status

Enum ErrorStatus

Source
#[non_exhaustive]
#[repr(i32)]
pub enum ErrorStatus {
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 ErrorStatus

Source

pub fn maybe_client_error(self) -> bool

Source

pub fn api_error(self, message: Option<impl Into<String>>) -> ApiError

Generate an ApiError.

Source

pub fn api_error_one_segment( self, s1: CodeSegment, message: Option<impl Into<String>>, ) -> ApiError

Append 2 digits at the end of the current code in the form of a decimal literal and generate an ApiError.

Source

pub fn api_error_two_segment( self, s1: CodeSegment, s2: CodeSegment, message: Option<impl Into<String>>, ) -> ApiError

Append 2*2 digits at the end of the current code in the form of a decimal literal and generate an ApiError.

Source

pub fn api_error_three_segment( self, s1: CodeSegment, s2: CodeSegment, s3: CodeSegment, message: Option<impl Into<String>>, ) -> ApiError

Append 2*3 digits at the end of the current code in the form of a decimal literal and generate an ApiError.

Trait Implementations§

Source§

impl BitOr<CodeSegment> for ErrorStatus

Append two digits at the end in the form of a decimal literal.

Source§

type Output = i32

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: CodeSegment) -> Self::Output

Performs the | operation. Read more
Source§

impl Clone for ErrorStatus

Source§

fn clone(&self) -> ErrorStatus

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

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ErrorStatus

Source§

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

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

impl Display for ErrorStatus

Source§

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

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

impl From<ErrorStatus> for i32

Source§

fn from(enum_value: ErrorStatus) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ErrorStatus

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 TryFrom<i32> for ErrorStatus

Source§

type Error = TryFromPrimitiveError<ErrorStatus>

The type returned in the event of a conversion error.
Source§

fn try_from(number: i32) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
Source§

impl TryFromPrimitive for ErrorStatus

Source§

impl Copy for ErrorStatus

Source§

impl Eq for ErrorStatus

Source§

impl StructuralPartialEq for ErrorStatus

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<Data> ApiSuccessResponse for Data

Source§

fn api_response<Meta>(self, meta: Option<Meta>) -> ApiResponse<Self, Meta>

Source§

fn api_response_without_meta<Meta>(self) -> ApiResponse<Self, Meta>

Source§

fn api_response_with_meta<Meta>(self, meta: Meta) -> ApiResponse<Self, Meta>

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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§

default 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.