pub enum RetryAfter {
Delay(Duration),
Date {
year: i32,
month: u8,
day: u8,
hour: u8,
minute: u8,
second: u8,
},
}Expand description
A parsed Retry-After header value per RFC 9110 §10.2.3.
Servers send this header to indicate how long a user agent ought to wait before issuing a follow-up request. The grammar is
Retry-After = HTTP-date / delay-seconds
delay-seconds = 1*DIGITWe surface both variants — the delay-seconds form as a
std::time::Duration for direct sleep-arithmetic, the HTTP-date
form as the same six-tuple (year, month, day, hour, minute, second) that the §5.6.7 parsers return so the caller can compare
against its own clock without dragging a date-time crate in. The
driver does NOT itself wall-clock the date — interpreting “wait
until this absolute time” requires a clock the source does not
own.
Variants§
Delay(Duration)
Retry-After: <N> — delay this many seconds from receipt of
the response. §10.2.3 mandates a non-negative decimal integer
(1*DIGIT).
Date
Retry-After: <HTTP-date> — wait until this absolute UTC time.
All three §5.6.7 forms are accepted on the receiver side
(IMF-fixdate / rfc850-date / asctime-date), matching the MUST
in §5.6.7.
Trait Implementations§
Source§impl Clone for RetryAfter
impl Clone for RetryAfter
Source§fn clone(&self) -> RetryAfter
fn clone(&self) -> RetryAfter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more