pub struct RetryStrategy { /* private fields */ }Expand description
Retry strategy.
Implementations§
Source§impl RetryStrategy
impl RetryStrategy
Sourcepub fn new(config: RetryConfig) -> Self
pub fn new(config: RetryConfig) -> Self
Creates a new retry strategy with the given configuration.
Sourcepub fn default_strategy() -> Self
pub fn default_strategy() -> Self
Creates a retry strategy with default configuration.
Sourcepub fn should_retry(&self, error: &Error, attempt: u32) -> bool
pub fn should_retry(&self, error: &Error, attempt: u32) -> bool
Sourcepub fn calculate_delay(&self, attempt: u32, error: &Error) -> Duration
pub fn calculate_delay(&self, attempt: u32, error: &Error) -> Duration
Sourcepub fn config(&self) -> &RetryConfig
pub fn config(&self) -> &RetryConfig
Returns a reference to the retry configuration.
Sourcepub fn max_retries(&self) -> u32
pub fn max_retries(&self) -> u32
Returns the maximum number of retries.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RetryStrategy
impl RefUnwindSafe for RetryStrategy
impl Send for RetryStrategy
impl Sync for RetryStrategy
impl Unpin for RetryStrategy
impl UnwindSafe for RetryStrategy
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