pub enum FastCasError<E> {
Abort {
current: usize,
error: E,
attempts: u32,
},
Conflict {
current: usize,
attempts: u32,
},
}Expand description
Terminal crate::FastCas failure.
Variants§
Abort
The operation aborted from a user decision.
Fields
§
error: EBusiness error returned by the operation.
Conflict
CAS conflicts exhausted the retry policy.
Implementations§
Source§impl<E> FastCasError<E>
impl<E> FastCasError<E>
Sourcepub const fn current(&self) -> usize
pub const fn current(&self) -> usize
Returns the current state captured by the terminal failure.
§Returns
The observed state code at failure.
Sourcepub const fn attempts(&self) -> u32
pub const fn attempts(&self) -> u32
Returns the number of attempts consumed before failure.
§Returns
Number of attempts executed by the operation.
Sourcepub const fn is_conflict(&self) -> bool
pub const fn is_conflict(&self) -> bool
Tests whether this failure came from exhausted CAS conflicts.
§Returns
true for FastCasError::Conflict.
Sourcepub const fn error(&self) -> Option<&E>
pub const fn error(&self) -> Option<&E>
Returns the business error for abort failures.
§Returns
Some(error) for abort failures, or None for conflict failures.
Sourcepub fn into_error(self) -> Option<E>
pub fn into_error(self) -> Option<E>
Consumes this failure and returns the business error when present.
§Returns
Some(error) for abort failures, or None for conflict failures.
Trait Implementations§
Source§impl<E: Clone> Clone for FastCasError<E>
impl<E: Clone> Clone for FastCasError<E>
Source§fn clone(&self) -> FastCasError<E>
fn clone(&self) -> FastCasError<E>
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<E: Debug> Debug for FastCasError<E>
impl<E: Debug> Debug for FastCasError<E>
Source§impl<E: PartialEq> PartialEq for FastCasError<E>
impl<E: PartialEq> PartialEq for FastCasError<E>
Source§fn eq(&self, other: &FastCasError<E>) -> bool
fn eq(&self, other: &FastCasError<E>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<E: Copy> Copy for FastCasError<E>
impl<E: Eq> Eq for FastCasError<E>
impl<E> StructuralPartialEq for FastCasError<E>
Auto Trait Implementations§
impl<E> Freeze for FastCasError<E>where
E: Freeze,
impl<E> RefUnwindSafe for FastCasError<E>where
E: RefUnwindSafe,
impl<E> Send for FastCasError<E>where
E: Send,
impl<E> Sync for FastCasError<E>where
E: Sync,
impl<E> Unpin for FastCasError<E>where
E: Unpin,
impl<E> UnsafeUnpin for FastCasError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for FastCasError<E>where
E: UnwindSafe,
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