pub struct RetryCount(/* private fields */);Expand description
NewType wrapper for retry counts to provide type safety
This type provides semantic meaning to retry counts and prevents accidental mixing with other numeric types.
§Examples
use waitup::RetryCount;
// Common retry patterns
let few_retries = RetryCount::FEW; // 3 retries
let moderate = RetryCount::MODERATE; // 5 retries
let many = RetryCount::MANY; // 10 retries
// Custom retry count
let custom = RetryCount::new(7);
assert_eq!(custom.get(), 7);
// Unlimited retries (None represents unlimited)
let unlimited = RetryCount::unlimited();Implementations§
Source§impl RetryCount
impl RetryCount
Sourcepub const AGGRESSIVE: Self
pub const AGGRESSIVE: Self
Aggressive retries (20) - for long-running services
Trait Implementations§
Source§impl Clone for RetryCount
impl Clone for RetryCount
Source§fn clone(&self) -> RetryCount
fn clone(&self) -> RetryCount
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 RetryCount
impl Debug for RetryCount
Source§impl Display for RetryCount
impl Display for RetryCount
Source§impl From<RetryCount> for u32
impl From<RetryCount> for u32
Source§fn from(count: RetryCount) -> Self
fn from(count: RetryCount) -> Self
Converts to this type from the input type.
Source§impl From<u32> for RetryCount
impl From<u32> for RetryCount
Source§impl Hash for RetryCount
impl Hash for RetryCount
Source§impl Ord for RetryCount
impl Ord for RetryCount
Source§fn cmp(&self, other: &RetryCount) -> Ordering
fn cmp(&self, other: &RetryCount) -> 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 RetryCount
impl PartialEq for RetryCount
Source§impl PartialOrd for RetryCount
impl PartialOrd for RetryCount
impl Copy for RetryCount
impl Eq for RetryCount
impl StructuralPartialEq for RetryCount
Auto Trait Implementations§
impl Freeze for RetryCount
impl RefUnwindSafe for RetryCount
impl Send for RetryCount
impl Sync for RetryCount
impl Unpin for RetryCount
impl UnwindSafe for RetryCount
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.