pub struct Extra(/* private fields */);Expand description
The untyped catalog extension: arbitrary top-level JSON sections beyond the base
video/audio/text media sections and shared archive, captured and republished verbatim.
This is the extension a caller reaches for when the section names aren’t known at
compile time, e.g. across the FFI/C boundary where a typed CatalogExt struct can’t
cross. Publish/consume a Catalog<Extra> and use set/get.
The default extension stays () (unknown sections dropped); opt into Extra explicitly.
version, video, audio, sync, text, archive, clock, media, json, binary,
stats, echo, include, and the retired timeline key are reserved, so decoding and
set reject them to keep the wire JSON free of duplicate or retired keys. The
exceptions are a root clock and media, which each held the clock before sync: an older
publisher’s is dropped on decode, so its media still plays.
Implementations§
Source§impl Extra
impl Extra
Sourcepub fn iter(&self) -> impl Iterator<Item = (&String, &Value)>
pub fn iter(&self) -> impl Iterator<Item = (&String, &Value)>
Iterate over every section as (name, value) pairs, sorted by name.
Sourcepub fn set(&mut self, name: impl Into<String>, value: Value) -> Result<()>
pub fn set(&mut self, name: impl Into<String>, value: Value) -> Result<()>
Set (or replace) a section. Errors if name collides with a reserved member of either
catalog: hang’s root version and base sections
(video/audio/sync/text/archive/clock/media/json/binary/stats/echo/include),
the retired timeline key that the wire format forbids beside archive, or a root member
MSF defines ([moq_msf::reserved_root]).
The same sections ride both catalog tracks, so a name reserved on either is refused on both. Without the MSF half a colliding name reaches that track as a duplicate JSON key, which serde emits without complaint.