MoQ is under active development. APIs and protocols may change between releases.

Skip to content

moq-binary ​

crates.iodocs.rs

Opaque payloads over moq-net tracks, in two modes:

  • snapshot: lossy latest-value, one payload per group.
  • stream: lossless append-log in a single group.

The bytes are never inspected. Compression is moq-flate, the same group-scoped DEFLATE moq-json uses.

Config is the codec options. The track-owning pair is producer::Config / consumer::Config. Compression is a shared Compression enum (None or Deflate), not a bool: both sides set the same field.

rust
let mut config = moq_binary::snapshot::Config::default();
config.compression = moq_binary::Compression::Deflate;

let mut producer = moq_binary::snapshot::Producer::new(track, config);
producer.update(payload)?;

A payload is stamped when written, unless it carries its capture time: moq_net::Timed::from(bytes).at(captured). Writes return the encoded frame size.

The TypeScript twin is @moq/binary. API: docs.rs/moq-binary.

Licensed under MIT or Apache-2.0