moqtap-codec
Pure data transformation. No I/O, no state.
What it does
Section titled “What it does”moqtap-codec parses raw bytes into typed MoQT control messages and serializes them back. It handles:
- Varint encoding/decoding (RFC 9000 format)
- Key-Value-Pair parsing
- All draft-14 control message types
- Data stream header parsing
- Datagram parsing
- Draft-version-aware dispatch
use moqtap_codec::{parse, serialize, DraftVersion};
// Parse bytes into a messagelet (message, warnings) = parse(&bytes, DraftVersion::Draft14)?;
// Serialize back to byteslet bytes = serialize(&message, DraftVersion::Draft14);Lenient parsing
Section titled “Lenient parsing”The codec never panics on malformed input. Unknown message types, unexpected field lengths, and unknown parameters produce ParseWarning entries:
let (msg, warnings) = parse(&bytes, DraftVersion::Draft14)?;for w in &warnings { eprintln!("Warning: {}", w);}Dependencies
Section titled “Dependencies”Only bytes and serde. Zero I/O dependencies.