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
//! Inputs and outputs of `RateLimiter::run` that callers see directly.
//! `Snapshot` is the user-visible state mirror that surfaces in
//! `meta.rate_limit` of the JSON envelope. `AttemptOutcome` is the
//! caller's classification of how the request resolved, fed back into
//! the limiter so it can update persistent state under the held lock.
//! `RunResult` couples the closure's value with the post-flight state
//! mirror.
use crateBlockReason;
/// Public view of the limiter state at the moment the caller observed it.
/// Surfaces in `meta.rate_limit` of the JSON envelope.
/// What the caller's request resolved to. The limiter uses this to update
/// persistent state under the held lock.
/// Result of a single `run` call: the value the caller produced, the
/// limiter snapshot taken after post-flight state update, and the
/// classified outcome (kept for callers that want to distinguish a
/// successful response from a recorded block without re-inspecting the
/// snapshot timestamps).