pub struct HttpRetryOptions {
pub enabled: bool,
pub max_attempts: u32,
pub max_duration: Option<Duration>,
pub delay_strategy: Delay,
pub jitter_factor: f64,
pub method_policy: HttpRetryMethodPolicy,
pub retry_status_codes: Option<Vec<StatusCode>>,
pub retry_error_kinds: Option<Vec<HttpErrorKind>>,
}Expand description
Retry settings for crate::HttpClient.
Fields§
§enabled: boolWhether built-in retry is enabled.
max_attempts: u32Maximum number of attempts, including the first request.
max_duration: Option<Duration>Optional maximum total retry duration.
delay_strategy: DelayDelay strategy between attempts.
jitter_factor: f64Jitter factor passed to the retry delay strategy.
method_policy: HttpRetryMethodPolicyMethod replay policy.
retry_status_codes: Option<Vec<StatusCode>>Optional retryable status-code allowlist.
When set, only listed statuses are retryable for status errors.
retry_error_kinds: Option<Vec<HttpErrorKind>>Optional retryable error-kind allowlist for non-status failures.
When set, only listed kinds are retryable for non-status errors.
Implementations§
Source§impl HttpRetryOptions
impl HttpRetryOptions
Sourcepub fn from_config<R>(config: &R) -> Result<Self, HttpConfigError>where
R: ConfigReader + ?Sized,
pub fn from_config<R>(config: &R) -> Result<Self, HttpConfigError>where
R: ConfigReader + ?Sized,
Creates HttpRetryOptions from config using relative keys.
§Parameters
config: AnyConfigReaderscoped to the retry section.
§Returns
Parsed retry options or HttpConfigError.
Sourcepub fn validate(&self) -> Result<(), HttpConfigError>
pub fn validate(&self) -> Result<(), HttpConfigError>
Sourcepub fn allows_method(&self, method: &Method) -> bool
pub fn allows_method(&self, method: &Method) -> bool
Sourcepub fn is_retryable_status(&self, status: StatusCode) -> bool
pub fn is_retryable_status(&self, status: StatusCode) -> bool
Sourcepub fn is_retryable_error_kind(&self, kind: HttpErrorKind) -> bool
pub fn is_retryable_error_kind(&self, kind: HttpErrorKind) -> bool
Trait Implementations§
Source§impl Clone for HttpRetryOptions
impl Clone for HttpRetryOptions
Source§fn clone(&self) -> HttpRetryOptions
fn clone(&self) -> HttpRetryOptions
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 HttpRetryOptions
impl Debug for HttpRetryOptions
Source§impl Default for HttpRetryOptions
impl Default for HttpRetryOptions
Source§impl PartialEq for HttpRetryOptions
impl PartialEq for HttpRetryOptions
impl StructuralPartialEq for HttpRetryOptions
Auto Trait Implementations§
impl Freeze for HttpRetryOptions
impl RefUnwindSafe for HttpRetryOptions
impl Send for HttpRetryOptions
impl Sync for HttpRetryOptions
impl Unpin for HttpRetryOptions
impl UnsafeUnpin for HttpRetryOptions
impl UnwindSafe for HttpRetryOptions
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