pub struct Error { /* private fields */ }Expand description
Why a run, a compile or a function failed.
Implementations§
Source§impl Error
impl Error
Sourcepub fn service(
code: impl Into<Cow<'static, str>>,
message: impl Into<Cow<'static, str>>,
) -> Self
pub fn service( code: impl Into<Cow<'static, str>>, message: impl Into<Cow<'static, str>>, ) -> Self
An error carrying a function’s own code.
Sourcepub fn with_retryable(self, yes: bool) -> Self
pub fn with_retryable(self, yes: bool) -> Self
Overrides whether a retry may succeed.
Sourcepub fn with_source(self, source: impl Error + Send + Sync + 'static) -> Self
pub fn with_source(self, source: impl Error + Send + Sync + 'static) -> Self
Attaches the error that caused this one.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
May a retry succeed? A timeout says yes unless told otherwise; everything else says no.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<&Error> for ErrorRecord
impl From<&Error> for ErrorRecord
Source§impl Serialize for Error
Writes the error as {"code", "message", "retryable"}: Error::code,
Error::message and Error::is_retryable, in that order.
impl Serialize for Error
Writes the error as {"code", "message", "retryable"}: Error::code,
Error::message and Error::is_retryable, in that order.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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