Skip to main content

Extra

Struct Extra 

Source
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

Source

pub fn get(&self, name: &str) -> Option<&Value>

Look up a section by name.

Source

pub fn iter(&self) -> impl Iterator<Item = (&String, &Value)>

Iterate over every section as (name, value) pairs, sorted by name.

Source

pub fn len(&self) -> usize

The number of sections.

Source

pub fn is_empty(&self) -> bool

Whether there are no sections.

Source

pub fn set( &mut self, name: impl Into<String>, value: Value, ) -> Result<(), Error>

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.

Source

pub fn remove(&mut self, name: &str) -> Option<Value>

Remove a section, returning its previous value if present.

Trait Implementations§

Source§

impl Catalog for Extra

Source§

fn mpegts_mut(&mut self) -> Option<&mut Mpegts>

The section to record MPEG-TS details into, or None for an extension that doesn’t carry them. Read more
Source§

impl CatalogExt for Extra

Source§

impl Clone for Extra

Source§

fn clone(&self) -> Extra

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Extra

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Extra

Source§

fn default() -> Extra

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Extra

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Extra, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Extra

Source§

fn eq(&self, other: &Extra) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Extra

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Extra

Auto Trait Implementations§

§

impl Freeze for Extra

§

impl RefUnwindSafe for Extra

§

impl Send for Extra

§

impl Sync for Extra

§

impl Unpin for Extra

§

impl UnsafeUnpin for Extra

§

impl UnwindSafe for Extra

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CatalogExt for T
where T: Serialize + DeserializeOwned + Default + Clone + Send + Unpin + 'static,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more