Expand description
The name a draft gives a control message type ID.
A recorded trace stores a control message as a wire type ID and the draft it
was read under — mt and the header’s protocol: moq-transport-NN in a
.moqtrace file. Both halves are needed to name it, because the ids are
reused rather than retired: 0x07 is ANNOUNCE_OK through draft-13,
PUBLISH_NAMESPACE_OK on draft-14 and REQUEST_OK from draft-15 on, and 0x0E
moves TRACK_STATUS → TRACK_STATUS_OK → NAMESPACE_DONE across the same range.
A table keyed on the id alone can only hedge — SUBSCRIBE_DONE/PUBLISH_DONE
— and the hedge holds exactly while a rename keeps the number, which is not
what happened to 0x07, 0x08, 0x0E or 0x11.
So the lookup is per draft, and the per-draft half of it lives on each
draft’s own MessageType::name. Nothing here derives one draft’s names from
another’s. message_type_name is re-exported at the crate root.
The dispatch itself is crate::draft_table::by_draft — private, so not a
link — which
crate::setup_option_names uses for the other registry. The shared shape
has no catch-all in it at all, so a draft nobody has added yet is a compile
error here rather than the same quiet None a build that left a draft out
gets; see that module for what that buys and what it costs.
§A name is not a concept either
The names are reused as well as the ids, and track_status swaps which side
of the exchange it names at draft-13:
| Request | Response | |
|---|---|---|
| Drafts 07-12 | track_status_request (0x0D) | track_status (0x0E) |
| Drafts 13-20 | track_status (0x0D) | track_status_ok (0x0E) |
Every answer is right about its own draft, so comparing two of them by name yields a wrong conclusion out of two correct lookups.
§The names are the corpus’s
Each name() answers with the message_type field of that draft’s
transport/draftNN/codec/messages/*.json vectors — subscribe,
publish_namespace, goaway — which is the same string the JavaScript
codec’s MESSAGE_TYPE_MAP answers with for the same id. That shared
spelling is the point: a trace named by either implementation reads the same
way, and tests/message_type_names.rs compares all fourteen drafts against
the corpus in both directions so the two tables cannot drift apart quietly.
The corpus is test-only — Cargo.toml excludes it from the package — so
nothing here reads it at runtime. The names are transcribed into the draft
modules and the test is what holds the transcription honest.
Functions§
- message_
type_ name - The name draft
draftgives control message typeid, orNoneif that draft assigns the id nothing.