pub struct RetryPolicy {
pub max_retries: u32,
pub attempt_timeout: Duration,
pub initial_backoff: Duration,
pub max_backoff: Duration,
pub deadline: Duration,
pub jitter: JitterStrategy,
}Expand description
Retry configuration for HTTP fetch operations.
Fields§
§max_retries: u32Maximum number of retry attempts to perform after the initial request.
attempt_timeout: DurationTimeout applied to each individual HTTP attempt.
initial_backoff: DurationInitial delay before retrying after a failure.
max_backoff: DurationUpper bound applied to exponential backoff growth.
deadline: DurationOverall deadline that bounds the entire retry sequence.
jitter: JitterStrategyStrategy used to randomize the computed backoff.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn compute_backoff(&self, attempt: u32) -> Duration
pub fn compute_backoff(&self, attempt: u32) -> Duration
Compute backoff for a retry attempt using the selected jitter strategy.
Sourcepub fn default_backoff(&self, attempt: u32) -> Duration
pub fn default_backoff(&self, attempt: u32) -> Duration
Default exponential backoff with jitter following the AWS architecture guidance.
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§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
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