pub struct ConstRetryStrategy<const MAX_ATTEMPTS: u32, const INTERVAL_MS: u64>;Expand description
Zero-allocation retry strategy using const generics
Implementations§
Source§impl<const MAX_ATTEMPTS: u32, const INTERVAL_MS: u64> ConstRetryStrategy<MAX_ATTEMPTS, INTERVAL_MS>
impl<const MAX_ATTEMPTS: u32, const INTERVAL_MS: u64> ConstRetryStrategy<MAX_ATTEMPTS, INTERVAL_MS>
Sourcepub const fn max_attempts(&self) -> u32
pub const fn max_attempts(&self) -> u32
Returns the maximum number of retry attempts
Sourcepub const fn interval_ms(&self) -> u64
pub const fn interval_ms(&self) -> u64
Returns the retry interval in milliseconds
Sourcepub const fn should_retry(&self, attempt: u32) -> bool
pub const fn should_retry(&self, attempt: u32) -> bool
Determines if another retry attempt should be made
Trait Implementations§
Auto Trait Implementations§
impl<const MAX_ATTEMPTS: u32, const INTERVAL_MS: u64> Freeze for ConstRetryStrategy<MAX_ATTEMPTS, INTERVAL_MS>
impl<const MAX_ATTEMPTS: u32, const INTERVAL_MS: u64> RefUnwindSafe for ConstRetryStrategy<MAX_ATTEMPTS, INTERVAL_MS>
impl<const MAX_ATTEMPTS: u32, const INTERVAL_MS: u64> Send for ConstRetryStrategy<MAX_ATTEMPTS, INTERVAL_MS>
impl<const MAX_ATTEMPTS: u32, const INTERVAL_MS: u64> Sync for ConstRetryStrategy<MAX_ATTEMPTS, INTERVAL_MS>
impl<const MAX_ATTEMPTS: u32, const INTERVAL_MS: u64> Unpin for ConstRetryStrategy<MAX_ATTEMPTS, INTERVAL_MS>
impl<const MAX_ATTEMPTS: u32, const INTERVAL_MS: u64> UnwindSafe for ConstRetryStrategy<MAX_ATTEMPTS, INTERVAL_MS>
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