pub struct RetryState { /* private fields */ }Expand description
Retry state
Implementations§
Source§impl RetryState
impl RetryState
Sourcepub fn new(policy: RetryPolicy) -> Self
pub fn new(policy: RetryPolicy) -> Self
New state
Sourcepub fn next_delay(&self) -> Duration
pub fn next_delay(&self) -> Duration
Delay before next attempt
Sourcepub fn should_retry(&self, error: &Error) -> bool
pub fn should_retry(&self, error: &Error) -> bool
Should we retry?
Sourcepub fn policy(&self) -> &RetryPolicy
pub fn policy(&self) -> &RetryPolicy
Returns the policy
Trait Implementations§
Auto 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