pub struct CasError<T, E> { /* private fields */ }Expand description
Terminal CAS error returned by crate::CasExecutor.
Implementations§
Source§impl<T, E> CasError<T, E>
impl<T, E> CasError<T, E>
Sourcepub fn kind(&self) -> CasErrorKind
pub fn kind(&self) -> CasErrorKind
Returns the classified CAS error kind.
§Returns
High-level CAS error kind derived from the retry-layer reason and last attempt failure.
Sourcepub fn reason(&self) -> RetryErrorReason
pub fn reason(&self) -> RetryErrorReason
Sourcepub fn context(&self) -> CasContext
pub fn context(&self) -> CasContext
Sourcepub fn last_failure(&self) -> Option<&CasAttemptFailure<T, E>>
pub fn last_failure(&self) -> Option<&CasAttemptFailure<T, E>>
Returns the last CAS attempt failure when one exists.
§Returns
Some(&CasAttemptFailure<T, E>) when at least one attempt failed.
Trait Implementations§
Source§impl<T, E> Error for CasError<T, E>where
E: Error + 'static,
impl<T, E> Error for CasError<T, E>where
E: Error + 'static,
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the source business error when one exists.
§Returns
Some(&dyn Error) when the terminal CAS failure preserved a business
error implementing std::error::Error.
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<T, E> Freeze for CasError<T, E>where
E: Freeze,
impl<T, E> RefUnwindSafe for CasError<T, E>where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, E> Send for CasError<T, E>
impl<T, E> Sync for CasError<T, E>
impl<T, E> Unpin for CasError<T, E>where
E: Unpin,
impl<T, E> UnsafeUnpin for CasError<T, E>where
E: UnsafeUnpin,
impl<T, E> UnwindSafe for CasError<T, E>where
E: UnwindSafe,
T: RefUnwindSafe,
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