pub struct MachiError { /* private fields */ }Expand description
Kernel error with stable code, message, and optional source.
Implementations§
Source§impl MachiError
impl MachiError
Sourcepub fn new(code: ErrorCode, message: impl Into<String>) -> Self
pub fn new(code: ErrorCode, message: impl Into<String>) -> Self
Create an error with code and message.
Retry class defaults to ErrorCode::default_retry.
Sourcepub const fn with_retry(self, retry: RetryClass) -> Self
pub const fn with_retry(self, retry: RetryClass) -> Self
Attach retry classification (overrides default).
Sourcepub fn with_source(self, source: impl Error + Send + Sync + 'static) -> Self
pub fn with_source(self, source: impl Error + Send + Sync + 'static) -> Self
Attach a source error.
Sourcepub const fn retry_class(&self) -> RetryClass
pub const fn retry_class(&self) -> RetryClass
Retry class.
Trait Implementations§
Source§impl Clone for MachiError
impl Clone for MachiError
Source§fn clone(&self) -> MachiError
fn clone(&self) -> MachiError
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 moreSource§impl Debug for MachiError
impl Debug for MachiError
Source§impl Display for MachiError
impl Display for MachiError
Source§impl Error for MachiError
impl Error for MachiError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for MachiError
impl !UnwindSafe for MachiError
impl Freeze for MachiError
impl Send for MachiError
impl Sync for MachiError
impl Unpin for MachiError
impl UnsafeUnpin for MachiError
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