pub struct RetryState {
pub attempts: u32,
pub current_backoff: Duration,
/* private fields */
}Fields§
§attempts: u32§current_backoff: DurationImplementations§
Source§impl RetryState
impl RetryState
pub fn new(config: RetryConfig) -> Self
pub fn should_retry_error(&mut self, is_abort: bool) -> RetryDecision
pub fn should_retry_status( &mut self, status: u16, retry_after: Option<Duration>, ) -> RetryDecision
pub fn should_retry_status_with_text( &mut self, status: u16, status_text: Option<&str>, retry_after: Option<Duration>, ) -> RetryDecision
pub fn reset(&mut self)
Trait Implementations§
Source§impl Clone for RetryState
impl Clone for RetryState
Source§fn clone(&self) -> RetryState
fn clone(&self) -> RetryState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RetryState
impl RefUnwindSafe for RetryState
impl Send for RetryState
impl Sync for RetryState
impl Unpin for RetryState
impl UnwindSafe for RetryState
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