Skip to main content

moqtap_client/
lib.rs

1#![deny(missing_docs)]
2
3//! MoQT client library.
4//!
5//! Provides a full MoQT client stack with per-draft modules. Each enabled
6//! draft lives under its own module (e.g. [`draft14`]) containing its own
7//! connection, endpoint state machine, and per-flow state machines.
8//!
9//! The [`transport`] module is shared across drafts because it sits below
10//! the MoQT protocol layer (raw QUIC / WebTransport streams and datagrams).
11//!
12//! # Feature flags
13//!
14//! Enable a draft with `--features draft14` (or any of `draft07`..`draft23`).
15//! The default is `all-drafts`, which enables every one; select individual
16//! drafts with `default-features = false`. `webtransport` adds the
17//! WebTransport transport.
18//!
19//! # Modules
20//!
21//! - [`dispatch`] — Multi-draft entry-point types (`AnyConnection`,
22//!   `AnyClientEvent`, `AnyConnectionObserver`, `AnyRequest`)
23//! - [`transport`] — Transport abstraction (QUIC, WebTransport)
24//! - `forwarding_preference` — The Object Forwarding Preference each track's
25//!   objects have been framed as, on the drafts where that is a property of
26//!   the track
27//! - `track_locations` — How far each track's objects have reached, on the
28//!   drafts that make an end-of-track object's placement a protocol error
29//! - `malformed_tracks` — Which tracks this endpoint has withdrawn from, on
30//!   the drafts that answer a malformed one with control messages
31//! - `draft07`..`draft23` — One module per supported MoQT draft, each
32//!   enabled via the matching `draftNN` feature flag.
33
34#[cfg(feature = "draft07")]
35pub mod draft07;
36
37#[cfg(feature = "draft08")]
38pub mod draft08;
39
40#[cfg(feature = "draft09")]
41pub mod draft09;
42
43#[cfg(feature = "draft10")]
44pub mod draft10;
45
46#[cfg(feature = "draft11")]
47pub mod draft11;
48
49#[cfg(feature = "draft12")]
50pub mod draft12;
51
52#[cfg(feature = "draft13")]
53pub mod draft13;
54
55#[cfg(feature = "draft14")]
56pub mod draft14;
57
58#[cfg(feature = "draft15")]
59pub mod draft15;
60
61#[cfg(feature = "draft16")]
62pub mod draft16;
63
64#[cfg(feature = "draft17")]
65pub mod draft17;
66
67#[cfg(feature = "draft18")]
68pub mod draft18;
69
70#[cfg(feature = "draft19")]
71pub mod draft19;
72
73#[cfg(feature = "draft20")]
74pub mod draft20;
75
76#[cfg(feature = "draft21")]
77pub mod draft21;
78
79#[cfg(feature = "draft22")]
80pub mod draft22;
81
82#[cfg(feature = "draft23")]
83pub mod draft23;
84
85pub mod transport;
86
87/// What a track's objects have been framed as, for the nine drafts that make
88/// the Object Forwarding Preference a property of the track rather than of one
89/// object. Shared across those drafts because the observation is identical on
90/// all nine and only the answer to it differs.
91#[cfg(any(
92    feature = "draft07",
93    feature = "draft08",
94    feature = "draft09",
95    feature = "draft10",
96    feature = "draft11",
97    feature = "draft12",
98    feature = "draft13",
99    feature = "draft14",
100    feature = "draft15"
101))]
102pub mod forwarding_preference;
103
104/// How far each track's objects have reached, and where each one ended.
105///
106/// **Two rules, and the drafts that state them are not the same set.** Drafts
107/// 08 through 13 make an end-of-track object's Group and Object ID a protocol
108/// error when they name a place the track has already passed, which takes a
109/// record of where the track has reached; drafts 07 and 14 through 23 have no
110/// such sentence, draft-07 having no ordering condition on the status at all
111/// and draft-14 having replaced it with a prohibition on the publisher. Drafts
112/// 12 through 23 make an object *past* where an end-of-track object put the end
113/// a Malformed Track, which takes a record of that place instead.
114///
115/// So the module is compiled wherever either rule is, and which of its two
116/// entry points a draft calls is what says which rule it states. The overlap is
117/// drafts 12 and 13, where both hold. Draft-23 adds a third, which only it
118/// calls: an Object both received and signalled as not existing makes the
119/// track malformed (draft-23 Section 12.1).
120#[cfg(any(
121    feature = "draft08",
122    feature = "draft09",
123    feature = "draft10",
124    feature = "draft11",
125    feature = "draft12",
126    feature = "draft13",
127    feature = "draft14",
128    feature = "draft15",
129    feature = "draft16",
130    feature = "draft17",
131    feature = "draft18",
132    feature = "draft19",
133    feature = "draft20",
134    feature = "draft21",
135    feature = "draft22",
136    feature = "draft23"
137))]
138pub mod track_locations;
139
140/// What a Malformed Track is, for the drafts whose answer to one is a control
141/// message.
142///
143/// Drafts 12 and 13 Section 2.5 list the conditions that make a track
144/// malformed and give all of them one answer: "When a subscriber detects a
145/// Malformed Track, it MUST UNSUBSCRIBE from the Track and SHOULD deliver an
146/// error to the application." Drafts 14, 15 and 16 widen the same sentence to
147/// fetches — "it MUST UNSUBSCRIBE any subscription and FETCH_CANCEL any fetch
148/// for that Track from that publisher" — which is a second message and the
149/// same record. Drafts 17 through 23 replace both with a cancellation of the
150/// request's own stream — a reset rather than a message — and the record is
151/// compiled there too, because what it holds is *which track was given up and
152/// what for*, which is the same question whichever shape the answer takes. It
153/// is the conditions that vary by draft, not the record of them; the answer
154/// lives on each draft's connection.
155#[cfg(any(
156    feature = "draft12",
157    feature = "draft13",
158    feature = "draft14",
159    feature = "draft15",
160    feature = "draft16",
161    feature = "draft17",
162    feature = "draft18",
163    feature = "draft19",
164    feature = "draft20",
165    feature = "draft21",
166    feature = "draft22",
167    feature = "draft23"
168))]
169pub mod malformed_tracks;
170
171#[cfg(any(
172    feature = "draft11",
173    feature = "draft12",
174    feature = "draft13",
175    feature = "draft14",
176    feature = "draft15",
177    feature = "draft16"
178))]
179pub(crate) mod datagram_prefix;
180
181pub mod above_codec_rules;
182
183pub mod dispatch;