Skip to main content

moqtap_codec/draft23/
mod.rs

1//! MoQT wire codec for draft-23.
2//!
3//! The ALPN is `moqt-23`. The draft-23 wire format:
4//!
5//! - **The control message Length is a `vi64`** (Section 9, Figure 6) and is
6//!   bounded by the receiver's MAX_CONTROL_MESSAGE_SIZE, Setup Option 0x09
7//!   (Section 9.1.8), 65535 unless advertised higher. 0x09 is odd, so its
8//!   value is a Length and one `vi64`.
9//! - **FETCH is answered by REQUEST_OK.** Type 0x18 is "RESERVED (FETCH_OK in
10//!   <= 22)" (Table 5). A FETCH_OK may carry EXPIRES and LARGEST_OBJECT and
11//!   Track Properties (Section 9.3).
12//! - **REQUEST_ERROR ends in Error Details**, Key-Value-Pairs (Section
13//!   9.4.1): REDIRECT 0x01, which MUST accompany Error Code REDIRECT, and
14//!   UNSUPPORTED_PROPERTY 0x02 (Section 9.4.2.1, Section 9.4.2.2).
15//! - **NAMESPACE carries a parameter block** (Section 9.15, Figure 20).
16//! - **`FILL_PARAMETERS` (0x23) is a count, not a length** (Section 9.19.15),
17//!   and may appear in PUBLISH and SUBSCRIBE_TRACKS.
18//! - **`PAUSED` (0x11)**, default 0 (Section 9.19.18), and
19//!   **`SUBSCRIBE_TRACKS_ID` (0x36)** (Section 9.19.21).
20//! - **A Track Name MUST NOT be empty** (Section 2.4.1).
21//! - **Fetch streams**: an Object ID Delta in the same Group adds `delta + 2`
22//!   (Section 11.4.1.1); End of Range indicators are delta encoded (Section
23//!   11.4.2.1); Table 8 adds End of Gone Range `0x40C`, End of Group `0x80`
24//!   and End of Track `0x81`.
25//! - **Session termination codes 0x200-0x203, 0x300-0x306 and 0x400-0x401**,
26//!   and 0x6 MALFORMED_KEY_VALUE (Section 12.2). REQUEST_ERROR has
27//!   UNAVAILABLE 0xA and PUBLISH_DONE has EXPIRED_AUTH_TOKEN 0x7 (Section 12.3
28//!   and Section 12.4); neither REQUEST_ERROR 0x30 nor stream reset 0x6 is
29//!   assigned.
30//!
31//! # Where this codec had to choose
32//!
33//! Each decision is recorded at the site that makes it:
34//!
35//! - MAX_CONTROL_MESSAGE_SIZE is read as Length plus exactly one `vi64`, and
36//!   a value below 65535 is decoded as it arrived and refused on encode —
37//!   [`message::decode_max_control_message_size`]
38//! - the limit applies to the Message Length field, the body alone —
39//!   [`message::ControlMessage::decode_with_limit`]
40//! - a REDIRECT Error Detail's Track Name may be empty, and a repeated REDIRECT
41//!   detail is decoded and refused on encode — [`message::Redirect`]
42//! - any parameter in NAMESPACE is out of scope, because no parameter
43//!   definition names NAMESPACE — [`message::Namespace`]
44//! - `Object Payload Length` is present on an End of Range indicator, encoded
45//!   as 0, and absent on End of Group and End of Track —
46//!   [`data_stream::FetchObjectHeader`]
47//! - after End of Group or End of Track the prior Object ID is 2^64-1 for
48//!   every later entry, indicators included, and either one as the first
49//!   entry is refused — [`data_stream::FetchObjectReader`]
50//!
51//! # What this codec does not enforce
52//!
53//! REQUEST_UPDATE (Section 9.5) and REQUEST_OK (Section 9.3) list their
54//! parameters per kind of request. Which list applies depends on the request
55//! the frame answers or updates, which is session state, so
56//! [`message::parameter_in_scope`] holds each to the union of its lists.
57//! [`message::RequestOk::check_answers`] applies one REQUEST_OK list and the
58//! Track Properties rule when the caller knows the request.
59
60#[allow(missing_docs)]
61pub mod data_stream;
62pub mod error_codes;
63/// This draft's field names for a decoded control message.
64pub mod fields;
65#[allow(missing_docs)]
66pub mod message;
67#[allow(missing_docs)]
68pub mod types;