Skip to main content

Module message

Module message 

Source
Expand description

Draft-12 control message encoding and decoding.

Key changes from draft-11:

  • Subscribe: track_alias removed (moved to SubscribeOk)
  • SubscribeOk: track_alias added (after request_id)
  • SubscribeError: trailing track_alias removed
  • New messages: Publish (0x1D), PublishOk (0x1E), PublishError (0x1F)
  • Same message type IDs for all other messages
  • Same framing: type_id(vi) + payload_length(16) + payload
  • Same even/odd KVP encoding

Re-exportsΒ§

pub use crate::types::check_group_range;
pub use crate::types::check_location_range;
pub use crate::types::check_open_ended_group_range;

StructsΒ§

Announce
AnnounceCancel
AnnounceError
AnnounceOk
ClientSetup
Fetch
FetchCancel
FetchError
FetchOk
GoAway
MaxRequestId
Publish
PUBLISH message (type 0x1D).
PublishError
PUBLISH_ERROR message (type 0x1F).
PublishOk
PUBLISH_OK message (type 0x1E).
RequestsBlocked
ServerSetup
Subscribe
SUBSCRIBE message (type 0x03). Draft-12: no track_alias (moved to SubscribeOk).
SubscribeAnnounces
SubscribeAnnouncesError
SubscribeAnnouncesOk
SubscribeDone
SubscribeError
SUBSCRIBE_ERROR message (type 0x05). Draft-12: no trailing track_alias.
SubscribeOk
SUBSCRIBE_OK message (type 0x04). Draft-12: gains track_alias.
SubscribeUpdate
TrackStatus
TrackStatusRequest
Unannounce
Unsubscribe
UnsubscribeAnnounces

EnumsΒ§

ControlMessage
FetchPayload
FetchType
MessageType
Control message type IDs (draft-12).

ConstantsΒ§

AUTHORIZATION_TOKEN πŸ”’
AUTHORIZATION TOKEN, the Version Specific Parameter of Section 8.2.1.1.
DELIVERY_TIMEOUT πŸ”’
DELIVERY TIMEOUT, the Version Specific Parameter of Section 8.2.1.2.
KNOWN_PARAMETERS πŸ”’
Every Version Specific Parameter Type Section 8.2.1 names.
KNOWN_SETUP_PARAMETERS πŸ”’
Every Setup Parameter Type Section 8.3.2 names.
MAX_CACHE_DURATION πŸ”’
MAX_CACHE_DURATION, the Version Specific Parameter of Section 8.2.1.3.
REPEATABLE_PARAMETERS πŸ”’
The Version Specific Parameter Types whose own definition allows a repeat.
REPEATABLE_SETUP_PARAMETERS πŸ”’
The Setup Parameter Types whose own definition allows a repeat.
SETUP_AUTHORIZATION_TOKEN πŸ”’
AUTHORIZATION TOKEN, the Setup Parameter of Section 8.3.2.4.
SETUP_MAX_AUTH_TOKEN_CACHE_SIZE πŸ”’
MAX_AUTH_TOKEN_CACHE_SIZE, the Setup Parameter of Section 8.3.2.3.
SETUP_MAX_REQUEST_ID πŸ”’
MAX_REQUEST_ID, the Setup Parameter of Section 8.3.2.2.
SETUP_PATH πŸ”’
PATH, the Setup Parameter of Section 8.3.2.1.

FunctionsΒ§

check_authorization_tokens πŸ”’
Hold every AUTHORIZATION TOKEN parameter to the Token structure it names.
check_content πŸ”’
check_discriminators πŸ”’
Refuse a message whose optional fields disagree with the field that decides whether they are on the wire.
check_filter πŸ”’
Both halves of a Start Location travel together, and only the two absolute filters put one on the wire. The Filter Type is still a raw varint on this draft, so the range check the decoder applies belongs here too.
check_full_track_name πŸ”’
check_group_order πŸ”’
Refuse a Group Order of 0x0 on the messages that forbid it.
check_ranges πŸ”’
Refuse a request whose range ends before it starts.
check_receiver_parameters πŸ”’
Refuse a received parameter list only where Section 8.2 lets a receiver refuse it.
check_sender_parameters πŸ”’
Refuse a parameter list a sender is not allowed to put on the wire.
check_track_status πŸ”’
Hold a TRACK_STATUS Status Code and the fields after it to Section 8.21.
decode_parameters πŸ”’
Decode a Version Specific Parameter list.
decode_setup_parameters πŸ”’
Decode the Setup Parameters of a CLIENT_SETUP or SERVER_SETUP message.
encode_parameters πŸ”’
Encode a Version Specific Parameter list.
encode_setup_parameters πŸ”’
Encode the Setup Parameters of a CLIENT_SETUP or SERVER_SETUP message.
read_content_exists πŸ”’
Read a Content Exists flag, which carries the same sentence as Forward and also decides whether a Largest Location follows.
read_forward πŸ”’
Read a Forward flag: β€œAny other value is a protocol error and MUST terminate the session with a Protocol Violation”
read_group_order πŸ”’
Read a Group Order from a message that lets the publisher choose.
read_group_order_response πŸ”’
Read a Group Order from a message that must name a real order.
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.