Skip to main content

Module message

Module message 

Source
Expand description

Control message types with encode/decode. Draft-17 control message encoding and decoding.

Key differences from draft-16:

  • Framing: Type (varint) + Length (16-bit fixed) + Payload.
  • Unified SETUP (0x2F00) with delta-encoded KVP options (even/odd).
  • Parameters: count-prefixed, delta-encoded types, type-specific value encoding.
  • RequestOk/RequestError/PublishOk/PublishDone/FetchOk: no request_id.
  • Request messages gain required_request_id_delta.
  • New: PublishBlocked. FetchType gains AbsoluteJoining.
  • SubscribeOk/Publish/FetchOk gain track_properties after parameters.
  • Removed: ClientSetup, ServerSetup, MaxRequestId, RequestsBlocked, Unsubscribe, PublishNamespaceDone, PublishNamespaceCancel, FetchCancel.

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;

Structsยง

Fetch
FetchOk
FETCH_OK (0x18). No request_id in draft-17. end_of_track is uint8.
GoAway
Namespace
NamespaceDone
Publish
PublishBlocked
PublishDone
PUBLISH_DONE (0x0B). No request_id in draft-17.
PublishNamespace
PublishOk
PUBLISH_OK (0x1E). No request_id in draft-17.
RequestError
REQUEST_ERROR (0x05). No request_id in draft-17.
RequestOk
REQUEST_OK (0x07). No request_id in draft-17.
RequestUpdate
Setup
Unified SETUP (0x2F00). Replaces ClientSetup/ServerSetup.
Subscribe
SubscribeNamespace
SubscribeOk
SUBSCRIBE_OK (0x04). No request_id in draft-17. Gains track_properties.
TrackStatus

Enumsยง

ControlMessage
FetchPayload
FetchType
MessageType
ParamEncoding ๐Ÿ”’
How a parameter value is encoded on the wire.

Functionsยง

decode_kvp_delta ๐Ÿ”’
Decode delta-encoded KVPs with even/odd convention (for setup options and track properties). Read until buffer is exhausted.
decode_parameters ๐Ÿ”’
Decode a count-prefixed list of parameters with delta-encoded types.
encode_kvp_delta ๐Ÿ”’
Encode delta-encoded KVPs with even/odd convention.
encode_parameters ๐Ÿ”’
Encode a count-prefixed list of parameters with delta-encoded types.
param_encoding ๐Ÿ”’