Skip to main content

moqtap_codec/
lib.rs

1#![deny(missing_docs)]
2
3//! MoQT wire codec for
4//! [draft-07](https://www.ietf.org/archive/id/draft-ietf-moq-transport-07.html) through
5//! [draft-19](https://www.ietf.org/archive/id/draft-ietf-moq-transport-19.html).
6//!
7//! Each draft sits behind its own feature flag — `draft07` through `draft19`.
8//! The default is `all-drafts`, which enables every one of them.
9//!
10//! # Shared modules
11//!
12//! - [`varint`] — variable-length integers, in whichever encoding the draft
13//!   uses: RFC 9000 Section 16 through draft-16, MoQT's own from draft-17
14//! - [`kvp`] — Key-value parameter pairs used in control messages
15//! - [`types`] — Core protocol types (TrackNamespace, Location, enums)
16//! - [`version`] — Draft version enum, ALPN and varint encoding per draft
17//! - [`error`] — Codec error types and size limits
18//! - [`auth_token`], [`subscription_filter`], [`range_filter`] — parameter
19//!   values that carry a structure rather than opaque bytes
20//! - [`dispatch`], [`data_dispatch`] — runtime draft dispatch and draft-neutral
21//!   object framing
22//!
23//! # Draft-specific modules
24//!
25//! Each `draftNN` module provides control message and data stream encoding/decoding
26//! for that specific draft version. Enable via the corresponding feature flag.
27//!
28//! Each also carries an `error_codes` module holding that draft's error, status and
29//! termination code registries as enums. They are reached only through their draft —
30//! `draft14::error_codes::SessionErrorCode` — and nothing from them is re-exported at
31//! the crate root. Registry names recur across drafts while the code points behind
32//! them move: every one of the thirteen defines a `SessionErrorCode`, and drafts that
33//! share a spelling do not always share a value. A root-level re-export would collide
34//! outright, and disambiguating it would mean coining names that appear in no draft's
35//! table. The `draftNN` path is what fixes which table a code point came from.
36
37/// Unified types and version-aware decode/encode across drafts.
38///
39/// The `Any*` wrapper enums contain one variant per enabled draft feature.
40/// Enable multiple draft features (e.g. `draft07` + `draft14`) for runtime
41/// dispatch between drafts.
42pub mod dispatch;
43
44/// Draft-neutral object framing for data streams.
45///
46/// Readers and a writer that address the objects on a subgroup or fetch
47/// stream without exposing per-draft types. Re-exported from [`dispatch`].
48pub mod data_dispatch;
49
50/// MoQT wire codec for draft-07.
51#[cfg(feature = "draft07")]
52pub mod draft07;
53/// MoQT wire codec for draft-08.
54#[cfg(feature = "draft08")]
55pub mod draft08;
56/// MoQT wire codec for draft-09.
57#[cfg(feature = "draft09")]
58pub mod draft09;
59/// MoQT wire codec for draft-10.
60#[cfg(feature = "draft10")]
61pub mod draft10;
62/// MoQT wire codec for draft-11.
63#[cfg(feature = "draft11")]
64pub mod draft11;
65/// MoQT wire codec for draft-12.
66#[cfg(feature = "draft12")]
67pub mod draft12;
68/// MoQT wire codec for draft-13.
69#[cfg(feature = "draft13")]
70pub mod draft13;
71/// MoQT wire codec for draft-14.
72#[cfg(feature = "draft14")]
73pub mod draft14;
74/// MoQT wire codec for draft-15.
75#[cfg(feature = "draft15")]
76pub mod draft15;
77/// MoQT wire codec for draft-16.
78#[cfg(feature = "draft16")]
79pub mod draft16;
80/// MoQT wire codec for draft-17.
81#[cfg(feature = "draft17")]
82pub mod draft17;
83/// MoQT wire codec for draft-18.
84#[cfg(feature = "draft18")]
85pub mod draft18;
86/// MoQT wire codec for draft-19 (latest).
87#[cfg(feature = "draft19")]
88pub mod draft19;
89
90/// The Token structure carried by the AUTHORIZATION TOKEN parameter.
91///
92/// Drafts 11 through 19 define one structure and require a receiver to close
93/// the session when a value it understands does not match it.
94pub mod auth_token;
95
96/// The subscription filter carried by the SUBSCRIPTION_FILTER parameter, named
97/// LOCATION_FILTER from draft-19.
98///
99/// Drafts 15 and later moved SUBSCRIBE's Filter Type, Start Location and End
100/// Group into one length-prefixed parameter value.
101pub mod subscription_filter;
102
103/// The Range Filters draft-19 carries in parameter types 0x25 through 0x29.
104///
105/// A reader rather than a check: every rule the draft states about them is
106/// answered with a REQUEST_ERROR, which is a reply an endpoint sends and not a
107/// frame a decoder refuses.
108pub mod range_filter;
109
110/// Codec error types and size limits.
111pub mod error;
112/// Key-value parameter pair encoding and decoding.
113pub mod kvp;
114/// Core protocol types shared across drafts.
115pub mod types;
116/// QUIC variable-length integer encoding and decoding.
117pub mod varint;
118/// MoQT draft version enum for runtime dispatch.
119pub mod version;