Skip to main content

RetryStrategy

Trait RetryStrategy 

Source
pub trait RetryStrategy:
    Sealed
    + Send
    + Sync {
    // Required methods
    fn next_delay(&self, attempt: u32, error: &str) -> Option<Duration>;
    fn clone_box(&self) -> Box<dyn RetryStrategy>;
}
Expand description

Retry strategy trait for configuring step retry behavior.

§Sealed Trait

This trait is sealed and cannot be implemented outside of this crate. This allows the SDK maintainers to evolve the retry interface without breaking external code. If you need custom retry behavior, use the provided factory functions.

Required Methods§

Source

fn next_delay(&self, attempt: u32, error: &str) -> Option<Duration>

Returns the delay before the next retry attempt, or None if no more retries.

Source

fn clone_box(&self) -> Box<dyn RetryStrategy>

Clone the retry strategy into a boxed trait object.

Trait Implementations§

Source§

impl Clone for Box<dyn RetryStrategy>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§