pub struct RetryPolicy { /* private fields */ }
Expand description
Policy for retrying operations
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn new_exponential() -> Self
pub fn new_exponential() -> Self
Create a new retry policy with exponential backoff
Sourcepub fn new_linear() -> Self
pub fn new_linear() -> Self
Create a new retry policy with linear backoff
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 executor<E>(&self) -> RetryExecutor<E>where
E: Error + 'static,
pub fn executor<E>(&self) -> RetryExecutor<E>where
E: Error + 'static,
Create a retry executor for the given error type
Sourcepub fn forge_executor<E>(&self) -> RetryExecutor<E>where
E: ForgeError,
pub fn forge_executor<E>(&self) -> RetryExecutor<E>where
E: ForgeError,
Create a retry executor specifically for ForgeError types
Trait Implementations§
Auto 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