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
63
64
65
66
67
68
69
70
71
72
//! Stream reset codes for the moq-transport wire.
use crateError;
/// The stream died on our side, with no registry entry for why.
///
/// Deliberately separate from [`Error::to_code`], which encodes moq-lite's space. Those
/// codes are our own and unstandardized; these are the registry every moq-transport peer
/// reads. The same number means different things on the two wires, so the mappings must
/// not be interchanged: moq-lite's cancel is 0, which here is this.
pub const INTERNAL_ERROR: u32 = 0x0;
/// The stream was cancelled by either endpoint.
pub const CANCELLED: u32 = 0x1;
// Draft-19 section 3.3.4 also defines DELIVERY_TIMEOUT (0x2) and SESSION_CLOSED (0x3).
// Neither is named here because nothing we can currently detect earns them: the first is
// the negotiated timeout of section 8 rather than any expiry, and the second asserts the
// whole session is going away. Add them alongside the path that can actually prove one.
/// The code to reset a stream or send STOP_SENDING with.
///
/// Only cancellation maps, because only cancellation has a meaning both spaces agree on.
/// The rest of the registry is narrower than it looks: DELIVERY_TIMEOUT is the negotiated
/// timeout of draft-19 section 8, not any expiry we happen to hit, and SESSION_CLOSED
/// asserts the session is going away rather than one handle or one piece of content. Our
/// generic errors do not establish either, so claiming them would tell a peer something
/// specific and untrue.
///
/// Everything else is INTERNAL_ERROR, which is the honest answer: the stream died on our
/// side and we have no registry entry for why.