pub struct AttemptNumber(/* private fields */);Expand description
Attempt number for retry operations (1-based).
AttemptNumber represents which attempt is currently being made, starting from 1 for the first attempt. Must be at least 1, enforced by using NonZeroU32 as the underlying type.
§Examples
ⓘ
use eventcore_types::projection::AttemptNumber;
use std::num::NonZeroU32;
let first_attempt = AttemptNumber::new(NonZeroU32::new(1).expect("1 is non-zero"));
let retry_attempt = AttemptNumber::new(NonZeroU32::new(3).expect("3 is non-zero"));
// Zero attempts not allowed by type system
// let zero = NonZeroU32::new(0); // Returns NoneImplementations§
Source§impl AttemptNumber
impl AttemptNumber
pub fn new(raw_value: NonZero<u32>) -> AttemptNumber
Source§impl AttemptNumber
impl AttemptNumber
pub fn into_inner(self) -> NonZero<u32>
Trait Implementations§
Source§impl Clone for AttemptNumber
impl Clone for AttemptNumber
Source§fn clone(&self) -> AttemptNumber
fn clone(&self) -> AttemptNumber
Returns a duplicate of the value. Read more
1.0.0 · 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 AttemptNumber
impl Debug for AttemptNumber
Source§impl Display for AttemptNumber
impl Display for AttemptNumber
Source§impl Ord for AttemptNumber
impl Ord for AttemptNumber
Source§fn cmp(&self, other: &AttemptNumber) -> Ordering
fn cmp(&self, other: &AttemptNumber) -> Ordering
1.21.0 · 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 AttemptNumber
impl PartialEq for AttemptNumber
Source§impl PartialOrd for AttemptNumber
impl PartialOrd for AttemptNumber
impl Copy for AttemptNumber
impl Eq for AttemptNumber
impl StructuralPartialEq for AttemptNumber
Auto Trait Implementations§
impl Freeze for AttemptNumber
impl RefUnwindSafe for AttemptNumber
impl Send for AttemptNumber
impl Sync for AttemptNumber
impl Unpin for AttemptNumber
impl UnsafeUnpin for AttemptNumber
impl UnwindSafe for AttemptNumber
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