Skip to main content

Crate moq_json

Crate moq_json 

Source
Expand description

JSON publishing over moq-net tracks, in three modes:

  • snapshot: lossy. One JSON value updated over time; a consumer only gets the most recent value. Intermediate updates are collapsed and older groups are dropped.
  • stream: lossless. An ordered append-log of self-contained records; every record is preserved and delivered in order, nothing is ever superseded.
  • window: bounded. An ordered run of records appended to the back and dropped from the front, which a reader can join at any point.

Pick snapshot when consumers care about “what is the value now” (a catalog, a status document), stream when they care about every record of an unbounded log, and window when the publisher retires old records and a late reader should start from what is still retained.

Each mode comes in two layers. Producer/Consumer own a moq_net track and manage its groups. Encoder/Decoder are the same logic without the track: values in, frame payloads out (and back), with the encoder saying where the group boundaries fall. Reach for the codec layer when something else already owns the track, such as a moq_mux::container::Producer also managing a timeline and a catalog estimate.

Modules§

snapshot
Lossy latest-value JSON publishing over moq-net tracks.
stream
Append-log JSON publishing over moq-net tracks.
window
Sliding-window JSON publishing over moq-net tracks.

Structs§

Diff
The result of diffing a value into an RFC 7396 merge patch.

Enums§

Error
Errors produced while publishing or consuming JSON.

Functions§

diff
Generate an RFC 7396 merge patch transforming old into new.

Type Aliases§

Result
A Result using this crate’s Error.