parse_retry_after

Function parse_retry_after 

Source
pub fn parse_retry_after(value: &str, now_unix_seconds: i64) -> Option<Duration>
Expand description

Parse an HTTP Retry-After header value (DW-089) into a duration from NOW. Per RFC 9110 the value is either a non-negative integer (seconds to wait) or an IMF-fixdate (the time at which to retry). Returns None for anything else (the caller treats a missing/invalid header as no backoff signal). For the HTTP-date form the duration is max(0, date - now); a date in the past yields a zero duration (the advertised window has already elapsed).