pub struct BackoffSpec {
pub ratio: Option<f64>,
pub min: Option<String>,
pub max: Option<String>,
}Expand description
Retry-backoff settings carried by the map form of tries:
(tries: {count: N, backoff: {ratio, min, max}}). Each field is
optional — a missing key falls back to the op’s standalone
retry_backoff* param, then the built-in default. Durations are kept
as raw strings (e.g. "100ms", "10s") and parsed at wrap time by the
runtime, so this crate needs no time parser.
Fields§
§ratio: Option<f64>Geometric growth factor applied per retry: attempt k’s wait is
min * ratio^(k-1), capped at max. 2.0 (the default) doubles;
1.0 holds the wait constant at min. None = default.
min: Option<String>Backoff floor — the first retry’s wait (a duration string).
None = default (100ms). "0" disables pacing entirely.
max: Option<String>Backoff ceiling — the wait never exceeds this (a duration string).
None = default (10s).
Trait Implementations§
Source§impl Clone for BackoffSpec
impl Clone for BackoffSpec
Source§impl Debug for BackoffSpec
impl Debug for BackoffSpec
Source§impl Default for BackoffSpec
impl Default for BackoffSpec
Source§impl<'de> Deserialize<'de> for BackoffSpec
impl<'de> Deserialize<'de> for BackoffSpec
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
Source§impl PartialEq for BackoffSpec
impl PartialEq for BackoffSpec
Source§impl Serialize for BackoffSpec
impl Serialize for BackoffSpec
impl StructuralPartialEq for BackoffSpec
Auto Trait Implementations§
impl Freeze for BackoffSpec
impl RefUnwindSafe for BackoffSpec
impl Send for BackoffSpec
impl Sync for BackoffSpec
impl Unpin for BackoffSpec
impl UnsafeUnpin for BackoffSpec
impl UnwindSafe for BackoffSpec
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