pub enum RetryPolicy {
NoRetry,
Retry {
max_attempts: u8,
backoff_ms: u64,
},
}Expand description
Retry policy for step execution.
Variants§
NoRetry
Never retry - compensate immediately on failure.
Retry
Retry up to max_attempts times with optional backoff.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub const fn retries(max_attempts: u8) -> Self
pub const fn retries(max_attempts: u8) -> Self
Create a retry policy with the given max attempts and no backoff.
Sourcepub const fn retries_with_backoff(max_attempts: u8, backoff_ms: u64) -> Self
pub const fn retries_with_backoff(max_attempts: u8, backoff_ms: u64) -> Self
Create a retry policy with the given max attempts and backoff.
Sourcepub fn should_retry(&self, attempt: u8) -> bool
pub fn should_retry(&self, attempt: u8) -> bool
Check if retries are exhausted for the given attempt count.
Sourcepub fn backoff_ms(&self) -> u64
pub fn backoff_ms(&self) -> u64
Get the backoff duration in milliseconds.
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
Source§fn default() -> RetryPolicy
fn default() -> RetryPolicy
Returns the “default value” for a type. Read more
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RetryPolicy
impl PartialEq for RetryPolicy
Source§impl Serialize for RetryPolicy
impl Serialize for RetryPolicy
impl Copy for RetryPolicy
impl Eq 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 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
Mutably borrows from an owned value. Read more