pub struct RetryExecutor<E> { /* private fields */ }
Expand description
Executor for retry operations
Implementations§
Source§impl<E> RetryExecutor<E>where
E: Error + 'static,
impl<E> RetryExecutor<E>where
E: Error + 'static,
Sourcepub fn new_exponential() -> Self
pub fn new_exponential() -> Self
Create a new retry executor with an exponential backoff strategy
Sourcepub fn new_linear() -> Self
pub fn new_linear() -> Self
Create a new retry executor with a linear backoff strategy
Sourcepub fn new_fixed(delay_ms: u64) -> Self
pub fn new_fixed(delay_ms: u64) -> Self
Create a new retry executor with a fixed backoff strategy
Sourcepub fn with_max_retries(self, max_retries: usize) -> Self
pub fn with_max_retries(self, max_retries: usize) -> Self
Set the maximum number of retries
Sourcepub fn with_retry_if<F>(self, predicate: F) -> Self
pub fn with_retry_if<F>(self, predicate: F) -> Self
Set a predicate to determine if an error should be retried
Auto Trait Implementations§
impl<E> Freeze for RetryExecutor<E>
impl<E> !RefUnwindSafe for RetryExecutor<E>
impl<E> Send for RetryExecutor<E>where
E: Send,
impl<E> Sync for RetryExecutor<E>where
E: Sync,
impl<E> Unpin for RetryExecutor<E>where
E: Unpin,
impl<E> !UnwindSafe for RetryExecutor<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