Skip to main content

Module message

Module message 

Source
Expand description

Draft-15 control message encoding and decoding.

Key changes from draft-14:

  • Version negotiation via ALPN — ClientSetup/ServerSetup have no versions
  • Consolidated RequestOk (0x07) and RequestError (0x05)
  • Subscribe simplified: request_id + ns + track_name + params
  • SubscribeOk simplified: request_id + track_alias + params
  • Publish simplified: request_id + ns + track_name + track_alias + params
  • PublishOk simplified: request_id + params
  • SubscribeUpdate: request_id + subscription_request_id + params
  • FetchOk: request_id + end_of_track + end_group + end_object + params
  • PublishDone (0x0B) replaces SubscribeDone
  • Framing: type_id(vi) + payload_length(16) + payload

Re-exports§

pub use crate::types::check_location_range;

Structs§

ClientSetup
CLIENT_SETUP (0x20). Draft-15: no versions, just parameters.
Fetch
FetchCancel
FetchOk
GoAway
MaxRequestId
Publish
PUBLISH (0x1D). Simplified: request_id + ns + name + alias + params.
PublishDone
PUBLISH_DONE (0x0B). Replaces SubscribeDone.
PublishNamespace
PUBLISH_NAMESPACE (0x06). request_id + namespace + params.
PublishNamespaceCancel
PUBLISH_NAMESPACE_CANCEL (0x0C). namespace + error_code + reason.
PublishNamespaceDone
PUBLISH_NAMESPACE_DONE (0x09). Just namespace.
PublishOk
PUBLISH_OK (0x1E). Simplified: request_id + params.
RequestError
REQUEST_ERROR (0x05). Consolidated error response for all request types.
RequestOk
REQUEST_OK (0x07). Consolidated OK response for all request types.
RequestsBlocked
ServerSetup
SERVER_SETUP (0x21). Draft-15: no version, just parameters.
Subscribe
SUBSCRIBE (0x03). Simplified: fields moved to parameters.
SubscribeNamespace
SubscribeOk
SUBSCRIBE_OK (0x04). Simplified: most fields moved to parameters.
SubscribeUpdate
SUBSCRIBE_UPDATE (0x02). request_id + subscription_request_id + params.
TrackStatus
TRACK_STATUS (0x0D). Same structure as Subscribe.
Unsubscribe
UnsubscribeNamespace
UNSUBSCRIBE_NAMESPACE (0x14). Just request_id.

Enums§

ControlMessage
FetchPayload
FetchType
MessageType

Constants§

KNOWN_SETUP_PARAMETERS 🔒
Every setup parameter type draft-15 names, from Section 9.3.1.
KNOWN_VERSION_SPECIFIC_PARAMETERS 🔒
Every version-specific parameter type draft-15 names, from the registry of Section 13.2, Table 10.
REPEATABLE_PARAMETER 🔒
The one parameter type whose own definition lets it repeat.

Functions§

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_no_duplicate_parameters_received 🔒
Refuse a received parameter list that repeats a type this draft names.
check_no_duplicate_parameters_sent 🔒
Refuse a parameter list a sender may not put on the wire.
check_parameter_value_ranges 🔒
Refuse a parameter whose value falls outside the range its type allows.
check_ranges 🔒
Refuse a FETCH whose range ends before it starts.
check_subscription_filters 🔒
Hold every SUBSCRIPTION_FILTER parameter to the filter structure it names.
decode_parameters 🔒
Decode a version-specific parameter list, refusing a repeated known type.
decode_setup_parameters 🔒
Decode a SETUP message’s parameter list, refusing a repeated known type.
encode_parameters 🔒
Encode a version-specific parameter list, refusing every list decode_parameters would refuse.
encode_setup_parameters 🔒
Encode a SETUP message’s parameter list.
parameter_value_in_range 🔒
Whether value is inside the range draft-15 allows for a version-specific 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.