pub struct ApiError { /* private fields */ }Expand description
Protocol-neutral API error envelope.
Implementations§
Source§impl ApiError
impl ApiError
Sourcepub const fn new(code: ErrorCode, message: ErrorMessage) -> Self
pub const fn new(code: ErrorCode, message: ErrorMessage) -> Self
Creates an API error envelope.
Sourcepub const fn with_category(self, category: ErrorCategory) -> Self
pub const fn with_category(self, category: ErrorCategory) -> Self
Sets the error category.
Sourcepub const fn with_retryable(self, retryable: bool) -> Self
pub const fn with_retryable(self, retryable: bool) -> Self
Marks the error as retryable or not retryable.
Sourcepub const fn is_retryable(&self) -> bool
pub const fn is_retryable(&self) -> bool
Returns true when retrying may be useful.
Trait Implementations§
impl Eq for ApiError
impl StructuralPartialEq for ApiError
Auto Trait Implementations§
impl Freeze for ApiError
impl RefUnwindSafe for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnsafeUnpin for ApiError
impl UnwindSafe for ApiError
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