Expand description
Draft-12 control message encoding and decoding.
Key changes from draft-11:
- Subscribe:
track_aliasremoved (moved to SubscribeOk) - SubscribeOk:
track_aliasadded (after request_id) - SubscribeError: trailing
track_aliasremoved - 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
- Announce
Cancel - Announce
Error - Announce
Ok - Client
Setup - Fetch
- Fetch
Cancel - Fetch
Error - FetchOk
- GoAway
- MaxRequest
Id - Publish
- PUBLISH message (type 0x1D).
- Publish
Error - PUBLISH_ERROR message (type 0x1F).
- Publish
Ok - PUBLISH_OK message (type 0x1E).
- Requests
Blocked - Server
Setup - Subscribe
- SUBSCRIBE message (type 0x03). Draft-12: no track_alias (moved to SubscribeOk).
- Subscribe
Announces - Subscribe
Announces Error - Subscribe
Announces Ok - Subscribe
Done - Subscribe
Error - SUBSCRIBE_ERROR message (type 0x05). Draft-12: no trailing track_alias.
- Subscribe
Ok - SUBSCRIBE_OK message (type 0x04). Draft-12: gains track_alias.
- Subscribe
Update - Track
Status - Track
Status Request - Unannounce
- Unsubscribe
- Unsubscribe
Announces
EnumsΒ§
- Control
Message - Fetch
Payload - Fetch
Type - Message
Type - 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.