pub struct RetryOrdinal(/* private fields */);Expand description
The zero-based invocation ordinal for one retry key.
RetryOrdinal::INITIAL identifies the first component call, which is not
a retry. Ordinal r identifies the r-th re-invocation.
Implementations§
Source§impl RetryOrdinal
impl RetryOrdinal
Sourcepub fn new(value: u32) -> Result<Self, FaultPolicyError>
pub fn new(value: u32) -> Result<Self, FaultPolicyError>
Validates and constructs a retry ordinal.
§Errors
Returns FaultPolicyError::RetryOrdinalOutOfRange above 65,535.
Sourcepub const fn is_initial(self) -> bool
pub const fn is_initial(self) -> bool
Returns whether this is the initial, non-retried call.
Sourcepub fn checked_next(self) -> Result<Self, FaultPolicyError>
pub fn checked_next(self) -> Result<Self, FaultPolicyError>
Returns the next ordinal.
§Errors
Returns FaultPolicyError::RetryOrdinalOutOfRange instead of
wrapping past the bounded representation.
Trait Implementations§
Source§impl Clone for RetryOrdinal
impl Clone for RetryOrdinal
Source§fn clone(&self) -> RetryOrdinal
fn clone(&self) -> RetryOrdinal
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 moreimpl Copy for RetryOrdinal
Source§impl Debug for RetryOrdinal
impl Debug for RetryOrdinal
Source§impl Default for RetryOrdinal
impl Default for RetryOrdinal
Source§fn default() -> RetryOrdinal
fn default() -> RetryOrdinal
Returns the “default value” for a type. Read more
impl Eq for RetryOrdinal
Source§impl Hash for RetryOrdinal
impl Hash for RetryOrdinal
Source§impl Ord for RetryOrdinal
impl Ord for RetryOrdinal
Source§fn cmp(&self, other: &RetryOrdinal) -> Ordering
fn cmp(&self, other: &RetryOrdinal) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for RetryOrdinal
impl PartialEq for RetryOrdinal
Source§impl PartialOrd for RetryOrdinal
impl PartialOrd for RetryOrdinal
impl StructuralPartialEq for RetryOrdinal
Auto Trait Implementations§
impl Freeze for RetryOrdinal
impl RefUnwindSafe for RetryOrdinal
impl Send for RetryOrdinal
impl Sync for RetryOrdinal
impl Unpin for RetryOrdinal
impl UnsafeUnpin for RetryOrdinal
impl UnwindSafe for RetryOrdinal
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