pub struct AutoSleep {
pub threshold: Duration,
pub io_errors_as_flood_of: Option<Duration>,
}Expand description
Retry policy that will retry once on flood-wait and slow mode wait errors.
The library will sleep only if the duration to sleep for is below or equal to the threshold.
Fields§
§threshold: DurationThe (inclusive) threshold below which the library should automatically sleep.
io_errors_as_flood_of: Option<Duration>Some if I/O errors should be treated as a flood error that would last the specified duration.
This duration will ignore the threshold and always be slept on on the first I/O error.
Trait Implementations§
Source§impl RetryPolicy for AutoSleep
impl RetryPolicy for AutoSleep
Source§fn should_retry(&self, ctx: &RetryContext) -> ControlFlow<(), Duration>
fn should_retry(&self, ctx: &RetryContext) -> ControlFlow<(), Duration>
Determines whether the failing request should retry. Read more
Auto Trait Implementations§
impl Freeze for AutoSleep
impl RefUnwindSafe for AutoSleep
impl Send for AutoSleep
impl Sync for AutoSleep
impl Unpin for AutoSleep
impl UnsafeUnpin for AutoSleep
impl UnwindSafe for AutoSleep
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