#[non_exhaustive]pub struct RetryPolicy {
pub max_attempts: u32,
pub delay_ms: u64,
pub backoff: RetryBackoff,
pub max_delay_ms: u64,
pub on_exhausted: StepFailureAction,
}Expand description
Retry behavior for a step command.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_attempts: u32Maximum number of attempts, including the first execution.
delay_ms: u64Fixed delay or initial exponential delay in milliseconds.
backoff: RetryBackoffDelay progression. Omitted fixed policies preserve the pre-v1 history encoding exactly.
max_delay_ms: u64Maximum exponential delay in milliseconds. Zero is canonical for a fixed policy.
on_exhausted: StepFailureActionAction taken after the final permitted attempt fails.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn fixed(max_attempts: u32, delay: Duration) -> Self
pub fn fixed(max_attempts: u32, delay: Duration) -> Self
Creates a fixed-delay retry policy.
max_attempts is clamped to at least one and delays larger than
u64::MAX milliseconds are saturated.
Sourcepub fn exponential(
max_attempts: u32,
initial_delay: Duration,
maximum_delay: Duration,
) -> Self
pub fn exponential( max_attempts: u32, initial_delay: Duration, maximum_delay: Duration, ) -> Self
Creates a capped exponential policy with deterministic full jitter.
The first delay is clamped to at least one millisecond, the maximum is
clamped to at least the first delay, and every delay is selected from
1..=current_cap using the immutable run, step, and failed-attempt
identities. Restarts therefore retain the same backoff decision without
coordinating random state.
Sourcepub fn with_failure_action(self, action: StepFailureAction) -> Self
pub fn with_failure_action(self, action: StepFailureAction) -> Self
Sets the action taken after retry exhaustion.
Sourcepub fn continue_workflow_on_failure(self) -> Self
pub fn continue_workflow_on_failure(self) -> Self
Configures replay to continue after the final step failure.
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RetryPolicy
Source§impl Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
Source§impl<'de> Deserialize<'de> for RetryPolicy
impl<'de> Deserialize<'de> for RetryPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RetryPolicy
Source§impl PartialEq for RetryPolicy
impl PartialEq for RetryPolicy
Source§impl Serialize for RetryPolicy
impl Serialize for RetryPolicy
impl StructuralPartialEq for RetryPolicy
Auto Trait Implementations§
impl Freeze for RetryPolicy
impl RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnsafeUnpin for RetryPolicy
impl UnwindSafe for RetryPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.