pub struct ApiErr { /* private fields */ }Expand description
A builder for quickly creating ApiError.
Implementations§
Source§impl ApiErr
impl ApiErr
Sourcepub const fn new0() -> Self
pub const fn new0() -> Self
Create an ApiError builder with an error code format of {ErrorCode}.
Sourcepub const fn new1(s1: CodeSegment) -> Self
pub const fn new1(s1: CodeSegment) -> Self
Create an ApiError builder with an error code format of {ErrorCode}{CodeSegment}.
Sourcepub const fn new2(s1: CodeSegment, s2: CodeSegment) -> Self
pub const fn new2(s1: CodeSegment, s2: CodeSegment) -> Self
Create an ApiError builder with an error code format of {ErrorCode}{CodeSegment}{CodeSegment}.
Sourcepub const fn new3(s1: CodeSegment, s2: CodeSegment, s3: CodeSegment) -> Self
pub const fn new3(s1: CodeSegment, s2: CodeSegment, s3: CodeSegment) -> Self
Create an ApiError builder with an error code format of
{ErrorCode}{CodeSegment}{CodeSegment}{CodeSegment}.
pub const fn intro(self, intro: &'static str) -> Self
pub fn cancelled(&self, message: impl Into<MaybeString>) -> ApiError
pub fn unknown(&self, message: impl Into<MaybeString>) -> ApiError
pub fn invalid_argument(&self, message: impl Into<MaybeString>) -> ApiError
pub fn deadline_exceeded(&self, message: impl Into<MaybeString>) -> ApiError
pub fn not_found(&self, message: impl Into<MaybeString>) -> ApiError
pub fn already_exists(&self, message: impl Into<MaybeString>) -> ApiError
pub fn permission_denied(&self, message: impl Into<MaybeString>) -> ApiError
pub fn resource_exhausted(&self, message: impl Into<MaybeString>) -> ApiError
pub fn failed_precondition(&self, message: impl Into<MaybeString>) -> ApiError
pub fn aborted(&self, message: impl Into<MaybeString>) -> ApiError
pub fn out_of_range(&self, message: impl Into<MaybeString>) -> ApiError
pub fn unimplemented(&self, message: impl Into<MaybeString>) -> ApiError
pub fn internal(&self, message: impl Into<MaybeString>) -> ApiError
pub fn data_loss(&self, message: impl Into<MaybeString>) -> ApiError
pub fn unauthenticated(&self, message: impl Into<MaybeString>) -> ApiError
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ApiErr
impl RefUnwindSafe for ApiErr
impl Send for ApiErr
impl Sync for ApiErr
impl Unpin for ApiErr
impl UnwindSafe for ApiErr
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