pub struct RetryPolicy {
pub max_retries: u32,
pub initial_delay: Duration,
pub max_delay: Duration,
}Expand description
Retry policy for API calls
Fields§
§max_retries: u32Maximum number of retry attempts
initial_delay: DurationInitial delay before first retry
max_delay: DurationMaximum delay between retries
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn with_max_retries(self, max_retries: u32) -> Self
pub fn with_max_retries(self, max_retries: u32) -> Self
Sets the maximum number of retry attempts
Sourcepub fn with_initial_delay(self, delay: Duration) -> Self
pub fn with_initial_delay(self, delay: Duration) -> Self
Sets the initial delay before first retry
Sourcepub fn with_max_delay(self, delay: Duration) -> Self
pub fn with_max_delay(self, delay: Duration) -> Self
Sets the maximum delay between retries
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RetryPolicy
impl RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin 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