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`..`draft21`).
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`..`draft21` — 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
79pub mod transport;
80
81/// What a track's objects have been framed as, for the nine drafts that make
82/// the Object Forwarding Preference a property of the track rather than of one
83/// object. Shared across those drafts because the observation is identical on
84/// all nine and only the answer to it differs.
85#[cfg(any(
86    feature = "draft07",
87    feature = "draft08",
88    feature = "draft09",
89    feature = "draft10",
90    feature = "draft11",
91    feature = "draft12",
92    feature = "draft13",
93    feature = "draft14",
94    feature = "draft15"
95))]
96pub mod forwarding_preference;
97
98/// How far each track's objects have reached, and where each one ended.
99///
100/// **Two rules, and the drafts that state them are not the same set.** Drafts
101/// 08 through 13 make an end-of-track object's Group and Object ID a protocol
102/// error when they name a place the track has already passed, which takes a
103/// record of where the track has reached; drafts 07 and 14 through 20 have no
104/// such sentence, draft-07 having no ordering condition on the status at all
105/// and draft-14 having replaced it with a prohibition on the publisher. Drafts
106/// 12 through 20 make an object *past* where an end-of-track object put the end
107/// a Malformed Track, which takes a record of that place instead.
108///
109/// So the module is compiled wherever either rule is, and which of its two
110/// entry points a draft calls is what says which rule it states. The overlap is
111/// drafts 12 and 13, where both hold.
112#[cfg(any(
113    feature = "draft08",
114    feature = "draft09",
115    feature = "draft10",
116    feature = "draft11",
117    feature = "draft12",
118    feature = "draft13",
119    feature = "draft14",
120    feature = "draft15",
121    feature = "draft16",
122    feature = "draft17",
123    feature = "draft18",
124    feature = "draft19",
125    feature = "draft20",
126    feature = "draft21"
127))]
128pub mod track_locations;
129
130/// What a Malformed Track is, for the drafts whose answer to one is a control
131/// message.
132///
133/// Drafts 12 and 13 Section 2.5 list the conditions that make a track
134/// malformed and give all of them one answer: "When a subscriber detects a
135/// Malformed Track, it MUST UNSUBSCRIBE from the Track and SHOULD deliver an
136/// error to the application." Drafts 14, 15 and 16 widen the same sentence to
137/// fetches — "it MUST UNSUBSCRIBE any subscription and FETCH_CANCEL any fetch
138/// for that Track from that publisher" — which is a second message and the
139/// same record. Drafts 17 through 21 replace both with a cancellation of the
140/// request's own stream — a reset rather than a message — and the record is
141/// compiled there too, because what it holds is *which track was given up and
142/// what for*, which is the same question whichever shape the answer takes. It
143/// is the conditions that vary by draft, not the record of them; the answer
144/// lives on each draft's connection.
145#[cfg(any(
146    feature = "draft12",
147    feature = "draft13",
148    feature = "draft14",
149    feature = "draft15",
150    feature = "draft16",
151    feature = "draft17",
152    feature = "draft18",
153    feature = "draft19",
154    feature = "draft20",
155    feature = "draft21"
156))]
157pub mod malformed_tracks;
158
159pub mod above_codec_rules;
160
161pub mod dispatch;