#[non_exhaustive]pub struct Retry {
pub attempts: i64,
pub wait: Option<Duration>,
pub backoff_mode: BackoffMode,
/* private fields */
}
Expand description
Retries the failed job.
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.attempts: i64
Required. Total number of retries. Retry is skipped if set to 0; The minimum value is 1, and the maximum value is 10.
wait: Option<Duration>
Optional. How long to wait for the first retry. Default is 0, and the maximum value is 14d.
backoff_mode: BackoffMode
Optional. The pattern of how wait time will be increased. Default is
linear. Backoff mode will be ignored if wait
is 0.
Implementations§
Source§impl Retry
impl Retry
pub fn new() -> Self
Sourcepub fn set_attempts<T: Into<i64>>(self, v: T) -> Self
pub fn set_attempts<T: Into<i64>>(self, v: T) -> Self
Sets the value of attempts.
Sourcepub fn set_or_clear_wait<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_wait<T>(self, v: Option<T>) -> Self
Sets or clears the value of wait.
Sourcepub fn set_backoff_mode<T: Into<BackoffMode>>(self, v: T) -> Self
pub fn set_backoff_mode<T: Into<BackoffMode>>(self, v: T) -> Self
Sets the value of backoff_mode.
Trait Implementations§
impl StructuralPartialEq 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 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