pub struct HttpRetryOptions {
pub attempts: Option<u32>,
pub initial_delay: Option<f64>,
pub max_delay: Option<f64>,
pub exp_base: Option<f64>,
pub jitter: Option<f64>,
pub http_status_codes: Option<Vec<u16>>,
}Expand description
HTTP retry options to be used in each of the requests.
Fields§
§attempts: Option<u32>Maximum number of attempts, including the original request. If 0 or 1, it means no retries. If not specified, defaults to 5.
initial_delay: Option<f64>Initial delay before the first retry, in seconds. Defaults to 1.0.
max_delay: Option<f64>Maximum delay between retries, in seconds. Defaults to 60.0.
exp_base: Option<f64>Multiplier by which the delay increases after each attempt. Defaults to 2.0.
jitter: Option<f64>Randomness factor for the delay, in seconds. Defaults to 1.0.
http_status_codes: Option<Vec<u16>>List of HTTP status codes that should trigger a retry.
If not specified, a default set of retryable codes (408, 429, and select 5xx) is used.
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§fn default() -> HttpRetryOptions
fn default() -> HttpRetryOptions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for HttpRetryOptions
impl<'de> Deserialize<'de> for HttpRetryOptions
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 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