pub struct BackoffParameters {
pub base_delay_ms: u64,
pub max_delay_ms: u64,
pub max_attempts: u32,
}Expand description
One backoff schedule: the numbers a retry decision is made with.
This is the shape both the flat policy-wide schedule and each per-class
override take (R0.10 wave 3): the backoff draws from
[0, base_delay_ms * 2^(attempt-1)] capped at max_delay_ms, and a
retryable failure dead-letters once attempt >= max_attempts.
Fields§
§base_delay_ms: u64Base of the exponential backoff schedule, in milliseconds.
max_delay_ms: u64Cap of the backoff schedule, in milliseconds.
max_attempts: u32Attempt budget: the number of attempts counting the initial one.
0 means no retries at all — every retryable failure dead-letters.
Implementations§
Source§impl BackoffParameters
impl BackoffParameters
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
The contract every backoff schedule — flat or per-class — must
satisfy: a positive base no larger than the cap, a cap inside the
declared envelope, and a budget inside the declared envelope.
Anything else is rejected (Err), so an out-of-envelope parameter
set can never become an active policy — the gate fails closed.