pub struct LinearRetryStrategy {
pub max_attempts: usize,
pub delay_between_repeats: Duration,
}
Fields§
§max_attempts: usize
§delay_between_repeats: Duration
Implementations§
Source§impl LinearRetryStrategy
impl LinearRetryStrategy
pub fn new() -> Self
pub fn max_attempts(self, max_attempts: usize) -> Self
pub fn delay_between_repeats(self, delay_between_repeats: Duration) -> Self
Trait Implementations§
Source§impl Default for LinearRetryStrategy
impl Default for LinearRetryStrategy
Source§impl RetryStrategy for LinearRetryStrategy
impl RetryStrategy for LinearRetryStrategy
Source§fn check_attempt(
&mut self,
attempts_before: usize,
) -> Result<Duration, TooManyAttempts>
fn check_attempt( &mut self, attempts_before: usize, ) -> Result<Duration, TooManyAttempts>
attempts_before
means how many attempts a future
was trying to resolve to Ok(_)
after returning Err(_)
.Auto Trait Implementations§
impl Freeze for LinearRetryStrategy
impl RefUnwindSafe for LinearRetryStrategy
impl Send for LinearRetryStrategy
impl Sync for LinearRetryStrategy
impl Unpin for LinearRetryStrategy
impl UnwindSafe for LinearRetryStrategy
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