Skip to main content

Module message

Module message 

Source
Expand description

Draft-20 control message encoding and decoding.

Key differences from draft-19:

  • FETCH (0x16) is a different message. The Fetch Type field is gone, and with it the Standalone Fetch and Joining Fetch structures and the Fetch Type registry. Track Namespace and Track Name are inline fields of FETCH, and the range travels in the LOCATION_FILTER parameter (Section 10.13, Figure 16).
  • PUBLISH_STATE_NOTIFY (0x22) is new and carries no Request ID (Section 10.10, Figure 13).
  • LOCATION_FILTER (0x21) has a new value shape. The Filter Type enum is gone; the shape comes from how many vi64 fields the value holds (Section 5.1.2).
  • FILL_PARAMETERS (0x23) is new: a length-prefixed parameter carrying a nested parameter block in its own scope (Section 10.2.15).
  • INCLUDE_PROPERTIES (0x35) is new: a uint8 restricted to 0 and 1 (Section 10.2.21).
  • Parameter applicability moved off PUBLISH_OK. Six definitions dropped it and several gained PUBLISH; only EXPIRES still names it.
  • PUBLISH_DONE’s SUBSCRIPTION_ENDED status (0x3) and REQUEST_ERROR’s INVALID_JOINING_REQUEST_ID (0x32) are unassigned here.
  • Section numbering shifted from Section 10.10 on; every reference in this module is draft-20’s own.

Re-exports§

pub use crate::error::CodecError;
pub use crate::error::MAX_GOAWAY_URI_LENGTH;
pub use crate::error::MAX_MESSAGE_LENGTH;
pub use crate::error::MAX_NAMESPACE_TUPLE_SIZE;
pub use crate::error::MAX_REASON_PHRASE_LENGTH;

Modules§

publish_done_codes
Numeric values for the PublishDone fields.
request_error_codes
REQUEST_ERROR error codes with dedicated meaning.

Structs§

Fetch
FETCH (0x16), rebuilt in draft-20 (Section 10.13, Figure 16).
FetchOk
FETCH_OK (0x18). end_of_track is uint8.
GoAway
GOAWAY (0x10). In draft-20 the Request ID field is removed, so the control-stream and request-stream forms are identical on the wire.
Namespace
NamespaceDone
Publish
PublishDone
PUBLISH_DONE (0x0B). The wire layout is unchanged from draft-19; what draft-20 changed is the Stream Count sentinel, what the count includes, and the removal of status code 0x3.
PublishNamespace
PublishSkipped
PUBLISH_SKIPPED (0x0F, renamed from PUBLISH_BLOCKED in draft-20; wire layout is unchanged).
PublishStateNotify
PUBLISH_STATE_NOTIFY (0x22), new in draft-20 (Section 10.10, Figure 13).
Redirect
Optional Redirect structure carried in REQUEST_ERROR with code 0x34.
RequestError
REQUEST_ERROR (0x05). Adds an optional Redirect structure when error_code is REDIRECT (0x34).
RequestOk
REQUEST_OK (0x07). Used as a generic OK response and as the alias for PUBLISH_OK / REQUEST_UPDATE_OK / TRACK_STATUS_OK / SUBSCRIBE_NAMESPACE_OK / PUBLISH_NAMESPACE_OK.
RequestUpdate
Setup
Unified SETUP (0x2F00).
Subscribe
SubscribeNamespace
SUBSCRIBE_NAMESPACE (0x50). Subscribes to NAMESPACE / NAMESPACE_DONE advertisements for namespaces matching namespace_prefix. The subscribe_options byte from draft-17 is removed; namespace subscriptions only produce NAMESPACE / NAMESPACE_DONE.
SubscribeOk
SUBSCRIBE_OK (0x04).
SubscribeTracks
SUBSCRIBE_TRACKS (0x51, new in draft-18). Subscribes to PUBLISH messages for tracks whose namespace matches namespace_prefix. Carries the FORWARD parameter (which previously lived on SUBSCRIBE_NAMESPACE).
TrackStatus

Enums§

ControlMessage
MessageType

Constants§

FILL_PARAMETERS
The FILL_PARAMETERS parameter type, draft-20 Section 10.2.15. New in draft-20.
LOCATION_FILTER
The LOCATION_FILTER parameter type, draft-20 Section 10.2.9.

Functions§

decode_fill_parameters
Decode the nested parameter block a FILL_PARAMETERS value carries.
decode_location_filter
Decode the vi64 fields of a draft-20 LOCATION_FILTER value.
parameter_in_scope
Whether draft-20 lets Message Parameter key appear in message.