Expand description
Draft-16 control message encoding and decoding.
Key changes from draft-15:
- SubscribeUpdate → RequestUpdate, field renamed to existing_request_id
- New: Namespace (0x08), NamespaceDone (0x0e) — namespace_suffix only
- Removed: UnsubscribeNamespace (0x14)
- RequestError gains retry_interval field
- SubscribeNamespace gains subscribe_options varint
- PublishNamespaceDone simplifies to just request_id
- Framing: type_id(vi) + payload_length(16) + payload (same as draft-15)
Re-exports§
pub use crate::types::check_location_range;
Structs§
- Client
Setup - Fetch
- Fetch
Cancel - FetchOk
- GoAway
- MaxRequest
Id - Namespace
- NAMESPACE (0x08). Carries namespace_suffix.
- Namespace
Done - NAMESPACE_DONE (0x0E). Carries namespace_suffix.
- Publish
- Publish
Done - Publish
Namespace - Publish
Namespace Cancel - PUBLISH_NAMESPACE_CANCEL (0x0C). Draft-16: request_id + error_code + reason.
- Publish
Namespace Done - PUBLISH_NAMESPACE_DONE (0x09). Draft-16: just request_id (was namespace in d15).
- Publish
Ok - Request
Error - REQUEST_ERROR (0x05). Draft-16 adds retry_interval field.
- Request
Ok - Request
Update - REQUEST_UPDATE (0x02). Renamed from SubscribeUpdate.
- Requests
Blocked - Server
Setup - Subscribe
- Subscribe
Namespace - SUBSCRIBE_NAMESPACE (0x11). Draft-16: gains subscribe_options varint.
- Subscribe
Ok - Track
Status - Unsubscribe
Enums§
Constants§
- AUTHORIZATION_
TOKEN 🔒 - The one Parameter Type draft-16 lets a message carry more than once.
- IMMUTABLE_
EXTENSIONS 🔒 - Immutable Extensions, Extension Header Type 0xB.
- KNOWN_
MESSAGE_ 🔒PARAMETERS - The Message Parameter types draft-16 defines, from the registry in Section 13.2: DELIVERY_TIMEOUT (0x02), AUTHORIZATION_TOKEN (0x03), EXPIRES (0x08), LARGEST_OBJECT (0x09), FORWARD (0x10), SUBSCRIBER_PRIORITY (0x20), SUBSCRIPTION_FILTER (0x21), GROUP_ORDER (0x22) and NEW_GROUP_REQUEST (0x32).
- KNOWN_
SETUP_ 🔒PARAMETERS - The Setup Parameter types draft-16 defines, from the definitions in Section 9.3.1: PATH (0x01), MAX_REQUEST_ID (0x02), AUTHORIZATION TOKEN (0x03), MAX_AUTH_TOKEN_CACHE_SIZE (0x04), AUTHORITY (0x05) and MOQT_IMPLEMENTATION (0x07).
Functions§
- add_
delta 🔒 - Resolve a delta-encoded Type against the Type before it.
- check_
authorization_ 🔒tokens - Hold every AUTHORIZATION TOKEN parameter to the Token structure it names.
- check_
discriminators 🔒 - Refuse a message whose discriminator disagrees with the fields beside it.
- check_
full_ 🔒track_ name - check_
message_ 🔒parameters_ are_ known - Refuse a Message Parameter whose type this draft does not define.
- check_
parameter_ 🔒value_ ranges - Refuse a Message Parameter whose value falls outside the range its type allows.
- check_
ranges 🔒 - Refuse a FETCH whose range ends before it starts.
- check_
received_ 🔒duplicate_ parameters - The receiver’s half: refuse a repeated Parameter Type this draft names, and carry a repeat of any other.
- check_
sent_ 🔒duplicate_ parameters - The sender’s half: refuse every repeated Parameter Type but the one whose definition allows it.
- check_
subscription_ 🔒filters - Hold every SUBSCRIPTION_FILTER parameter to the filter structure it names.
- check_
track_ 🔒extension_ values - Refuse a Track Extension whose value falls outside the range its type allows, wherever in the run it is carried.
- decode_
kvp_ 🔒delta_ pair - Read one Key-Value-Pair, resolving its Type against
prev_keyand advancingprev_keyto the resolved value. - decode_
parameters 🔒 - Decode the Message Parameters of a control message.
- decode_
parameters_ 🔒in - Decode a count-prefixed parameter list with delta-encoded Types, refusing a
repeat of a type in
known. - decode_
setup_ 🔒parameters - Decode the Setup Parameters of a CLIENT_SETUP or SERVER_SETUP.
- decode_
track_ 🔒extensions - Decode any remaining bytes in
bufas a run of delta-typed KVPs untilbufis empty. Used for draft-16track_extensions, which has no explicit count — extensions simply fill the rest of the control-message payload. - encode_
kvp_ 🔒delta_ pair - Write one Key-Value-Pair, encoding its Type as a delta from
prev_keyand advancingprev_keyto this pair’s Type. - encode_
parameters 🔒 - Encode the Message Parameters of a control message.
- encode_
parameters_ 🔒in - Encode a count-prefixed parameter list with delta-encoded Types, refusing
every list
decode_parameters_inwould refuse. - encode_
setup_ 🔒parameters - Encode the Setup Parameters of a CLIENT_SETUP or SERVER_SETUP.
- encode_
track_ 🔒extensions - Encode
track_extensions(each KVP back-to-back, no count prefix), with Types delta-encoded from 0. - parameter_
value_ 🔒in_ range - Whether
valueis inside the range draft-16 allows for a Message Parameter type that restricts one. - read_
reason_ 🔒phrase - Read a Reason Phrase, holding it to the cap this draft states for a receiver.
- read_u8 🔒
- Take one byte, or report the end of the buffer instead of panicking.
- track_
extension_ 🔒value_ in_ range - Whether
valueis inside the range draft-16 allows for an extension header type that restricts one.