pub struct FixedDelay {
pub delay: Duration,
pub max_attempts: u32,
}Expand description
Fixed delay retry policy.
Waits the same duration between each retry attempt. This is simpler than exponential backoff but may not be suitable for services under heavy load.
§Example
use error_rail::async_ext::FixedDelay;
use core::time::Duration;
let policy = FixedDelay::new(Duration::from_millis(500), 3);
// Delays: 500ms, 500ms, 500ms (then stops)Fields§
§delay: DurationDelay between retry attempts.
max_attempts: u32Maximum number of retry attempts.
Implementations§
Trait Implementations§
Source§impl Clone for FixedDelay
impl Clone for FixedDelay
Source§fn clone(&self) -> FixedDelay
fn clone(&self) -> FixedDelay
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FixedDelay
impl Debug for FixedDelay
Source§impl RetryPolicy for FixedDelay
impl RetryPolicy for FixedDelay
Auto Trait Implementations§
impl Freeze for FixedDelay
impl RefUnwindSafe for FixedDelay
impl Send for FixedDelay
impl Sync for FixedDelay
impl Unpin for FixedDelay
impl UnwindSafe for FixedDelay
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)