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-20](https://www.ietf.org/archive/id/draft-ietf-moq-transport-20.html).
6//!
7//! Each draft sits behind its own feature flag — `draft07` through `draft20`.
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//! - [`message_names`] — the name a draft gives a control message type ID,
23//! which needs both halves because the ids are reused across the range
24//!
25//! # Draft-specific modules
26//!
27//! Each `draftNN` module provides control message and data stream encoding/decoding
28//! for that specific draft version. Enable via the corresponding feature flag.
29//!
30//! Each also carries an `error_codes` module holding that draft's error, status and
31//! termination code registries as enums. They are reached only through their draft —
32//! `draft14::error_codes::SessionErrorCode` — and nothing from them is re-exported at
33//! the crate root. Registry names recur across drafts while the code points behind
34//! them move: every one of the fourteen defines a `SessionErrorCode`, and drafts that
35//! share a spelling do not always share a value. A root-level re-export would collide
36//! outright, and disambiguating it would mean coining names that appear in no draft's
37//! table. The `draftNN` path is what fixes which table a code point came from.
38
39pub mod dispatch;
40
41pub mod data_dispatch;
42
43#[cfg(feature = "draft07")]
44pub mod draft07;
45#[cfg(feature = "draft08")]
46pub mod draft08;
47#[cfg(feature = "draft09")]
48pub mod draft09;
49#[cfg(feature = "draft10")]
50pub mod draft10;
51#[cfg(feature = "draft11")]
52pub mod draft11;
53#[cfg(feature = "draft12")]
54pub mod draft12;
55#[cfg(feature = "draft13")]
56pub mod draft13;
57#[cfg(feature = "draft14")]
58pub mod draft14;
59#[cfg(feature = "draft15")]
60pub mod draft15;
61#[cfg(feature = "draft16")]
62pub mod draft16;
63#[cfg(feature = "draft17")]
64pub mod draft17;
65#[cfg(feature = "draft18")]
66pub mod draft18;
67#[cfg(feature = "draft19")]
68pub mod draft19;
69#[cfg(feature = "draft20")]
70pub mod draft20;
71
72/// The Token structure carried by the AUTHORIZATION TOKEN parameter.
73///
74/// Drafts 11 through 20 define one structure and require a receiver to close
75/// the session when a value it understands does not match it.
76pub mod auth_token;
77
78pub mod subscription_filter;
79
80pub mod range_filter;
81
82/// Codec error types and size limits.
83pub mod error;
84pub mod fields;
85/// Key-value parameter pair encoding and decoding.
86pub mod kvp;
87pub mod message_names;
88/// Core protocol types shared across drafts.
89pub mod types;
90/// QUIC variable-length integer encoding and decoding.
91pub mod varint;
92pub mod version;
93
94pub use message_names::message_type_name;