1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Retryability classification and `Retry-After` parsing.
//!
//! The retry loop itself lives in the core crate; this module provides the
//! header-level pieces adapters and the loop share.
use Duration;
use DateTime;
use Utc;
use Headers;
use StatusCode;
/// Returns `true` for 408, 409, 429 and every 5xx status.
/// Reads the delay requested by `retry-after-ms` (milliseconds) or
/// `retry-after` (seconds or HTTP date).
///
/// Returns `None` when neither header is present or parsable.
/// Applies the reference window: a `Retry-After` delay is used only when it
/// is at most `max` (default 60 s).