Expand description
Error and status code registries defined by draft-17.
One enum per IANA registry in Section 14.5 of the draft. Variant names are the draft’s own ALLCAPS names rewritten in Rust convention; each variant’s doc comment repeats the draft spelling so the mapping stays checkable.
Codes are per-registry, not global, and the overlap is not benign: every
value from 0x0 to 0x5 is assigned in all four registries, with a
different meaning in nearly every cell.
| code | session termination | REQUEST_ERROR | PUBLISH_DONE | data stream reset |
|---|---|---|---|---|
| 0x0 | NO_ERROR | INTERNAL_ERROR | INTERNAL_ERROR | INTERNAL_ERROR |
| 0x1 | INTERNAL_ERROR | UNAUTHORIZED | UNAUTHORIZED | CANCELLED |
| 0x2 | UNAUTHORIZED | TIMEOUT | TRACK_ENDED | DELIVERY_TIMEOUT |
| 0x3 | PROTOCOL_VIOLATION | NOT_SUPPORTED | SUBSCRIPTION_ENDED | SESSION_CLOSED |
| 0x4 | INVALID_REQUEST_ID | MALFORMED_AUTH_TOKEN | GOING_AWAY | UNKNOWN_OBJECT_STATUS |
| 0x5 | DUPLICATE_TRACK_ALIAS | EXPIRED_AUTH_TOKEN | EXPIRED | TOO_FAR_BEHIND |
| 0x9 | MALFORMED_PATH | EXCESSIVE_LOAD | EXCESSIVE_LOAD | EXCESSIVE_LOAD |
| 0x12 | DATA_STREAM_TIMEOUT | MALFORMED_TRACK | MALFORMED_TRACK | MALFORMED_TRACK |
| 0x19 | INVALID_AUTHORITY | DUPLICATE_SUBSCRIPTION | unassigned | unassigned |
Carrying a value from one of these types to another is therefore always a bug, even where the two happen to share a variant name. These type names also recur in the sibling draft modules over different assignments, so an import repointed at another draft still compiles while changing meaning.
Every table’s last row reserves 0x7f * N + 0x9D for greasing (Section 13).
Those code points carry no semantics, get no variants here, and are rejected
by from_u64 like any other unassigned value. Note that Section 13 of this
draft gives the formula as 0x7f * N + 0x9D but illustrates it with the
sequence 0x9D, 0xBC, ..., whose step is 0x1f rather than 0x7f; drafts
18 and 19 keep the same formula and correct the illustration to
0x9D, 0x11C, .... The formula is treated as normative. Either reading
leaves this module unchanged, since no greasing value gets a variant.
Enums§
- Data
Stream Reset Error Code - Data Stream Reset Error Codes (draft-17, Section 14.5.4).
- Publish
Done Status Code - PUBLISH_DONE Codes (draft-17, Section 14.5.3).
- Request
Error Code - REQUEST_ERROR Codes (draft-17, Section 14.5.2).
- Session
Error Code - Session Termination Error Codes (draft-17, Section 14.5.1).