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§
Sourcefn next_delay(&self, attempt: u32, error: &str) -> Option<Duration>
fn next_delay(&self, attempt: u32, error: &str) -> Option<Duration>
Returns the delay before the next retry attempt, or None if no more retries.
Sourcefn clone_box(&self) -> Box<dyn RetryStrategy>
fn clone_box(&self) -> Box<dyn RetryStrategy>
Clone the retry strategy into a boxed trait object.