pub struct RetryPolicy { /* private fields */ }Expand description
Deterministic retry policy.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn new(
max_attempts: u8,
backoff_millis: impl IntoIterator<Item = u64>,
) -> Self
pub fn new( max_attempts: u8, backoff_millis: impl IntoIterator<Item = u64>, ) -> Self
Creates a retry policy. Attempts are clamped to at least one.
Sourcepub const fn max_attempts(&self) -> u8
pub const fn max_attempts(&self) -> u8
Returns the maximum attempt count.
Sourcepub fn backoff_millis(&self) -> Vec<u64>
pub fn backoff_millis(&self) -> Vec<u64>
Returns the deterministic backoff schedule in milliseconds.
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
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 Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
Source§impl PartialEq for RetryPolicy
impl PartialEq for RetryPolicy
Source§fn eq(&self, other: &RetryPolicy) -> bool
fn eq(&self, other: &RetryPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for RetryPolicy
impl StructuralPartialEq for RetryPolicy
Auto Trait Implementations§
impl Freeze for RetryPolicy
impl RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnsafeUnpin for RetryPolicy
impl UnwindSafe for RetryPolicy
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