pub struct RetryConfig<E = Error> {
pub max_attempts: u32,
pub base_delay: Duration,
pub max_delay: Duration,
pub retry_if: Option<RetryPredicate<E>>,
}Expand description
Configuration for Retry.
Fields§
§max_attempts: u32Maximum total attempts (including the first). Default: 3.
base_delay: DurationInitial backoff. Default: 100ms.
max_delay: DurationCap on any single backoff. Default: 5s.
retry_if: Option<RetryPredicate<E>>Predicate that decides if a given error should be retried. Default: retry every error.
Trait Implementations§
Source§impl<E: Clone> Clone for RetryConfig<E>
impl<E: Clone> Clone for RetryConfig<E>
Source§fn clone(&self) -> RetryConfig<E>
fn clone(&self) -> RetryConfig<E>
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<E> Debug for RetryConfig<E>
impl<E> Debug for RetryConfig<E>
Auto Trait Implementations§
impl<E> Freeze for RetryConfig<E>
impl<E = Error> !RefUnwindSafe for RetryConfig<E>
impl<E> Send for RetryConfig<E>
impl<E> Sync for RetryConfig<E>
impl<E> Unpin for RetryConfig<E>
impl<E> UnsafeUnpin for RetryConfig<E>
impl<E = Error> !UnwindSafe for RetryConfig<E>
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