pub struct Retry { /* private fields */ }Expand description
Implementations§
Source§impl Retry
impl Retry
Sourcepub fn new(composition: impl Composition + 'static, max_attempts: u32) -> Self
pub fn new(composition: impl Composition + 'static, max_attempts: u32) -> Self
Creates a new retry composition
§Arguments
composition- The composition to retrymax_attempts- Maximum number of attempts (including the first)
Sourcepub fn with_backoff(self, backoff_ms: u64) -> Self
pub fn with_backoff(self, backoff_ms: u64) -> Self
Sets a custom backoff delay
The actual delay is backoff_ms * (attempt + 1) for exponential backoff
Trait Implementations§
Source§impl Composition for Retry
impl Composition for Retry
Auto Trait Implementations§
impl Freeze for Retry
impl !RefUnwindSafe for Retry
impl Send for Retry
impl Sync for Retry
impl Unpin for Retry
impl UnsafeUnpin for Retry
impl !UnwindSafe for Retry
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