pub fn backoff_delay(
attempt: u32,
policy: &RetryPolicy,
retry_after_secs: Option<u64>,
) -> Option<Duration>Expand description
Compute how long to wait before a retry attempt.
Uses exponential backoff with random jitter in [0, base_delay / 2).
If the error carries a Retry-After hint that is within max_delay,
that takes precedence.