Skip to main content

Module message

Module message 

Source
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§

ClientSetup
Fetch
FetchCancel
FetchOk
GoAway
MaxRequestId
Namespace
NAMESPACE (0x08). Carries namespace_suffix.
NamespaceDone
NAMESPACE_DONE (0x0E). Carries namespace_suffix.
Publish
PublishDone
PublishNamespace
PublishNamespaceCancel
PUBLISH_NAMESPACE_CANCEL (0x0C). Draft-16: request_id + error_code + reason.
PublishNamespaceDone
PUBLISH_NAMESPACE_DONE (0x09). Draft-16: just request_id (was namespace in d15).
PublishOk
RequestError
REQUEST_ERROR (0x05). Draft-16 adds retry_interval field.
RequestOk
RequestUpdate
REQUEST_UPDATE (0x02). Renamed from SubscribeUpdate.
RequestsBlocked
ServerSetup
Subscribe
SubscribeNamespace
SUBSCRIBE_NAMESPACE (0x11). Draft-16: gains subscribe_options varint.
SubscribeOk
TrackStatus
Unsubscribe

Enums§

ControlMessage
FetchPayload
FetchType
MessageType

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_key and advancing prev_key to 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 buf as a run of delta-typed KVPs until buf is empty. Used for draft-16 track_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_key and advancing prev_key to 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_in would 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 value is 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 value is inside the range draft-16 allows for an extension header type that restricts one.