Expand description
Draft-11 control message encoding and decoding.
Key changes from draft-09/10:
- Setup IDs: 0x40/0x41 -> 0x20/0x21
subscribe_id->request_idthroughout- MaxSubscribeId -> MaxRequestId, SubscribesBlocked -> RequestsBlocked
- Subscribe gains
track_aliasandforwardfields - SubscribeOk: no track_alias
- SubscribeError gains trailing
track_alias - SubscribeDone gains
stream_count - SubscribeUpdate uses start_group/start_object (not Location)
- Announce gains
request_id; AnnounceOk/AnnounceError userequest_id - AnnounceCancel:
namespace + error_code + reason_phrase - SubscribeAnnounces gains
request_id - TrackStatusRequest gains
request_idandparameters - TrackStatus restructured:
request_id + status_code + largest_location + parameters - Fetch restructured: 3 fetch types (Standalone, RelativeJoining, AbsoluteJoining)
- FetchOk: group_order + end_of_track + end_location (no track_alias)
- Uses even/odd KVP encoding (not d07 format)
- Framing: type_id(vi) + payload_length(16) + payload
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 message (type 0x06).
- Announce
Cancel - ANNOUNCE_CANCEL message (type 0x0C).
- Announce
Error - ANNOUNCE_ERROR message (type 0x08).
- Announce
Ok - ANNOUNCE_OK message (type 0x07).
- Client
Setup - CLIENT_SETUP message (type 0x20).
- Fetch
- FETCH message (type 0x16).
- Fetch
Cancel - FETCH_CANCEL message (type 0x17).
- Fetch
Error - FETCH_ERROR message (type 0x19).
- FetchOk
- FETCH_OK message (type 0x18).
- GoAway
- GOAWAY message (type 0x10).
- MaxRequest
Id - MAX_REQUEST_ID message (type 0x15).
- Requests
Blocked - REQUESTS_BLOCKED message (type 0x1A).
- Server
Setup - SERVER_SETUP message (type 0x21).
- Subscribe
- SUBSCRIBE message (type 0x03).
- Subscribe
Announces - SUBSCRIBE_ANNOUNCES message (type 0x11).
- Subscribe
Announces Error - SUBSCRIBE_ANNOUNCES_ERROR message (type 0x13).
- Subscribe
Announces Ok - SUBSCRIBE_ANNOUNCES_OK message (type 0x12).
- Subscribe
Done - SUBSCRIBE_DONE message (type 0x0B).
- Subscribe
Error - SUBSCRIBE_ERROR message (type 0x05).
- Subscribe
Ok - SUBSCRIBE_OK message (type 0x04).
- Subscribe
Update - SUBSCRIBE_UPDATE message (type 0x02).
- Track
Status - TRACK_STATUS message (type 0x0E).
- Track
Status Request - TRACK_STATUS_REQUEST message (type 0x0D).
- Unannounce
- UNANNOUNCE message (type 0x09).
- Unsubscribe
- UNSUBSCRIBE message (type 0x0A).
- Unsubscribe
Announces - UNSUBSCRIBE_ANNOUNCES message (type 0x14).
EnumsΒ§
- Control
Message - A parsed MoQT control message (draft-11).
- Fetch
Payload - Fetch-type-specific payload fields.
- Fetch
Type - Fetch type discriminant.
- Message
Type - Control message type IDs (draft-11).
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_
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.18.
- 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.