Skip to main content

Crate moq_json

Crate moq_json 

Source
Expand description

Snapshot/delta JSON publishing over moq-net tracks.

A JSON value is published over a track as a series of groups, where each group is self-contained: its first frame is a full snapshot and any following frames are RFC 7396 JSON Merge Patch deltas applied in order. A consumer jumps to the newest group, reads the snapshot, and applies the deltas, so a late joiner never needs older groups.

Deltas are controlled by ProducerConfig::delta_ratio. A ratio of 0 disables them, so every change is a fresh snapshot group, matching a plain “one JSON blob per group” track.

This root module is the “object” mode: one value, updated over time, where a late joiner only wants the latest state. For an ordered log of self-contained records that are never superseded (an event log, a media timeline), see stream.

Modules§

stream
Append-log JSON publishing over moq-net tracks.

Structs§

Consumer
Consumes a JSON value from a track, reconstructing it from snapshots and deltas.
ConsumerConfig
Configuration for a Consumer.
Diff
The result of diffing a value into an RFC 7396 merge patch.
Guard
An RAII editing guard returned by Producer::lock.
Producer
Publishes a JSON value over a track, choosing snapshots and deltas automatically.
ProducerConfig
Configuration for a Producer.

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.