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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Bounded ledger of recently-closed streams and how they closed.
//!
//! Consulted when a peer frame arrives on a stream id that's no longer in the active map to
//! pick the right error category per RFC 9113 §5.1. See [`ClosedReason`].
use ;
/// Why a stream transitioned to the closed state — dictates the error category for any
/// subsequent frame the peer sends on that stream id (RFC 9113 §5.1):
/// - `Reset`: closed via `RST_STREAM` (either direction). Subsequent frames → stream-level
/// `STREAM_CLOSED`.
/// - `EndStream`: closed via `END_STREAM` on both sides. Subsequent frames (other than
/// `WINDOW_UPDATE` / `PRIORITY` / `RST_STREAM`) → connection-level `STREAM_CLOSED`.
///
/// Streams that were never opened and are merely implicitly closed by a higher-id
/// HEADERS (§5.1.1) don't appear in the ledger; the fall-through case there is
/// connection-level `PROTOCOL_ERROR` per §5.1.1.
pub
/// Bounded FIFO of recently-closed streams and how they closed. Consulted when a peer
/// frame arrives on a stream id that's no longer in the active map to pick the right error
/// category per RFC 9113 §5.1.
///
/// Fixed cap — this is a correctness mechanism, not a concurrency-scaled structure. A
/// well-behaved peer never sends frames on a stream it knows is closed; the ledger only
/// needs to span a handful of RTTs between our close and a misbehaving peer's stale
/// frame. Oldest entries evict on overflow; evicted lookups fall through to the §5.1.1
/// connection-level `PROTOCOL_ERROR` default.
pub