moqtap_client/draft22/mod.rs
1//! MoQT client implementation for draft-22.
2//!
3//! Each draft lives in its own top-level module with a complete, independent
4//! implementation: connection, endpoint state machine, event types, observer
5//! trait, and per-flow state machines (subscribe, fetch, publish, namespace,
6//! track status). No code is shared across drafts — each draft carries its
7//! own copy because wire-level differences would make a shared layer leaky.
8//!
9//! Enable via the `draft22` feature.
10//!
11//! # What changed from draft-19, in the places a caller can feel it
12//!
13//! * **FETCH was rebuilt** (Section 9.11). The `Fetch Type` field, the
14//! Standalone and Joining Fetch structures and the whole joining mechanism
15//! are gone; the Track Namespace and Track Name are inline fields, and the
16//! range travels in the `LOCATION_FILTER` parameter. So
17//! [`Connection::fetch`](connection::Connection::fetch) takes a parameter
18//! list where draft-19's took four location varints, and
19//! `joining_fetch` / `absolute_joining_fetch` no longer exist. A fill fetch
20//! stream is what replaces them; see [`fill`].
21//! * **`FILL_PARAMETERS` (0x23) is new** (Section 9.20.15). Its presence on a
22//! SUBSCRIBE or a REQUEST_UPDATE asks the publisher to open a fill fetch
23//! stream — a unidirectional stream beginning with a FETCH_HEADER that
24//! carries the *subscription's* Request ID. [`fill::FillParameters`] builds
25//! the parameter and
26//! [`Endpoint::fill_requested`](endpoint::Endpoint::fill_requested) is what
27//! tells an arriving FETCH_HEADER apart from a fetch's.
28//! * **`PUBLISH_STATE_NOTIFY` (0x22) is new** (Section 9.10): a unilateral
29//! report from the publisher on a subscription's stream, answered with
30//! nothing and not counted against `MAX_REQUEST_UPDATES`. It arrives as
31//! [`ClientEvent::PublishStateNotify`](event::ClientEvent::PublishStateNotify).
32//! * **Ranges are inclusive at both ends** (Section 3.2, Section 3.3.1,
33//! Section 9.12). Draft-19's fetch end was "the last Object, plus 1; or 0 to
34//! indicate the entire Group"; both conventions are deleted, and nothing in
35//! this module carries the arithmetic forward.
36//! * **`INCLUDE_PROPERTIES` (0x35) is new** (Section 9.20.21): a uint8 opt-out
37//! from Track Properties on the responding OK, default 1.
38//! * Three code points went: `SUBSCRIPTION_ENDED` (PUBLISH_DONE 0x3),
39//! `VERSION_NEGOTIATION_FAILED` (session 0x15) and
40//! `INVALID_JOINING_REQUEST_ID` (REQUEST_ERROR 0x32).
41//! * There is still **no version on the wire**. The negotiated draft is the
42//! ALPN, `moqt-22` on raw QUIC, exactly as on every draft from 15 on.
43//!
44//! # What a caller feels against draft-21
45//!
46//! One wire change, to `LOCATION_FILTER` (Section 9.20.9). Its value opens
47//! with a `Location Filter Type` that names which fields follow, and carries
48//! no length, nested inside `FILL_PARAMETERS` or not. Two consequences reach
49//! a caller of [`fill::LocationFilter`]:
50//!
51//! * `{0, 0}` is an absolute start, the beginning of the track. The Next
52//! Object is a type of its own, 0x05, built by
53//! [`fill::LocationFilter::next_object`], and None is type 0x00, which is
54//! how a REQUEST_UPDATE takes a filter away.
55//! * A type outside the six Section 9.20.9 assigns is a PROTOCOL_VIOLATION,
56//! and the codec's `InvalidFilterType` is the session close
57//! [`Connection::codec_session_error_code`](connection::Connection::codec_session_error_code)
58//! gives it.
59//!
60//! Everything else is draft-21's, under draft-22's numbering: every citation
61//! in this module is draft-22's own.
62//!
63//! # What this module does not enforce
64//!
65//! Draft-22 lists the parameters a REQUEST_UPDATE (Section 9.5) and a
66//! REQUEST_OK (Section 9.3) may carry per kind of request — an update to a
67//! FETCH, for one, carries only `AUTHORIZATION_TOKEN` and
68//! `SUBSCRIBER_PRIORITY`. The codec holds each message to the union of its
69//! lists, because the frame does not say which request it updates or answers,
70//! and this endpoint does not narrow it to the list for the request's own
71//! kind. A parameter inside the union and outside its kind's list is accepted
72//! here.
73
74/// Outbound MoQT connection with MoQT framing over QUIC.
75pub mod connection;
76pub mod endpoint;
77pub mod event;
78/// Fetch lifecycle state machine.
79pub mod fetch;
80pub mod fill;
81/// Subscribe/Publish namespace state machines.
82pub mod namespace;
83pub mod observer;
84/// Publish lifecycle state machine.
85pub mod publish;
86pub mod session;
87/// Subscription lifecycle state machine.
88pub mod subscription;
89/// Track status lifecycle state machine.
90pub mod track_status;