#[non_exhaustive]pub struct RetryNotification<E> {
pub attempt: usize,
pub error: Error<E>,
pub delay: Duration,
}Expand description
Data passed into notify functions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.attempt: usizeOne-indexed attempt number. The first transient failure produces
attempt = 1, the second produces attempt = 2, and so on.
For finite retry functions (retry_operation,
retry_operation_while), the notify function is not called when
retries are exhausted. Instead, an error is returned.
error: Error<E>The retryable error that caused this retry. This error is always
retryable (i.e., error.is_retryable() returns true).
delay: DurationThe delay before the next attempt.
Trait Implementations§
Auto Trait Implementations§
impl<E> !Freeze for RetryNotification<E>
impl<E> !RefUnwindSafe for RetryNotification<E>
impl<E> Send for RetryNotification<E>where
E: Send,
impl<E> Sync for RetryNotification<E>where
E: Sync,
impl<E> Unpin for RetryNotification<E>where
E: Unpin,
impl<E> UnsafeUnpin for RetryNotification<E>where
E: UnsafeUnpin,
impl<E> !UnwindSafe for RetryNotification<E>
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