Skip to main content

Info

Struct Info 

Source
#[non_exhaustive]
pub struct Info { pub timescale: Option<Timescale>, pub max_age: Option<Duration>, pub priority: i8, pub compression: Compression, pub refresh: Refresh, /* private fields */ }
Expand description

Publisher-side properties of a track.

These are fixed by the publisher when the track is created and don’t change while the track is alive. A subscriber learns them via broadcast::Consumer::track, which returns the publisher’s Info once the subscription is accepted.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§timescale: Option<Timescale>

Units per second for per-frame timestamps on this track, or None for an untimed track.

A track is all timed or all untimed: every frame on a timed track carries a timestamp, none on an untimed one does, and a write that doesn’t match is refused with Error::TimestampMismatch. Defaults to None (untimed). On Lite05+ it is reported in TRACK_INFO and the publisher zigzag-delta encodes per-frame timestamps at this scale on the wire; on moq-transport it is the TIMESCALE Track Property. A track received without one (pre-Lite05 moq-lite, or moq-transport without TIMESCALE) is untimed.

§max_age: Option<Duration>

How long a superseded group stays fresh. The newest group is never stale.

A group is stale once either clock reaches the budget: the wall-clock time since its successor arrived at this hop, or how far its successor’s first timestamp trails the live edge (see Start::Live). An untimed track is judged by the wall clock alone, and a peer whose timestamps stop advancing cannot pin a superseded group.

A freshness bound on what may still be served, the inverse of an HTTP Cache-Control: max-age. A live join’s max is clamped to this, since a group can’t be waited for once it is stale. Reported in TRACK_INFO so relays re-serve with the same bound.

An authored track defaults to Some(Duration::ZERO): a superseded group is stale at once, so only the live edge is served, and a publisher that wants a reader to reach history sets a longer age, or None, explicitly. None sets no publisher limit: requested with with_max_age(None), and kept by a track received without one (an older moq-lite, or moq-transport without MAX_CACHE_DURATION). A hop’s cache still bounds what it keeps with its own pool and ceiling. Stale groups are skipped by readers; reclaiming their bytes is the cache pool’s expiry window.

This is the Publisher Max Age on the wire, the publisher-side half of the budget a live join’s max sets for a subscriber (see Start::Live).

Encoded as milliseconds in a QUIC varint, so a duration of 2^62 milliseconds or more cannot be put on lite-07 wires. moq-transport egress never sends it, since its MAX_CACHE_DURATION would also expire the newest group; a received one still sets it. Lite05/06 map values at or above 2^53 - 1 milliseconds to no limit for older JavaScript readers. Sub-millisecond precision is truncated (Duration::as_millis) at encode time.

§priority: i8

The publisher’s priority for this track, higher first, defaulting to 0.

It breaks ties between subscriptions of equal subscriber priority. Reported in TRACK_INFO (Lite05+).

§compression: Compression

How frames are compressed per group, so later frames compress against earlier ones in the same group. Defaults to Compression::None.

Writers and readers see plain frames either way: the producer compresses each frame as it is written and the cache stores the compressed form. A moq-lite-07 peer or a moq-transport peer negotiating the Flate extension receives the compressed bytes and the codec. Other sessions receive one shared inflated copy per group, unless a sealed compression declaration makes that fallback unsupported. Worth it for small, repetitive payloads like JSON; wasted on media.

§refresh: Refresh

When a reader asks for a new group: on a live join, on a Subscriber::refresh, or both. Defaults to never. See Refresh.

On moq-transport, a track that refreshes at all is advertised as DYNAMIC_GROUPS, which arrives as a Refresh::ratio of Some(0).

Implementations§

Source§

impl Info

Source

pub fn with_timescale(self, timescale: impl Into<Option<Timescale>>) -> Self

Set the per-frame timestamp scale, or None for an untimed track, returning self for chaining.

Defaults to None (untimed). On Lite05+ this scale is reported in TRACK_INFO and used to encode per-frame timestamps on the wire.

Source

pub fn with_max_age(self, max_age: impl Into<Option<Duration>>) -> Self

Set how long a superseded group stays fresh, or None for no publisher limit, returning self for chaining. See max_age.

Source

pub fn with_priority(self, priority: i8) -> Self

Set the publisher’s priority, returning self for chaining.

Source

pub fn with_compression(self, compression: Compression) -> Self

Set how frames are compressed per group, returning self for chaining.

Source

pub fn with_refresh(self, refresh: Refresh) -> Self

Set when a reader asks for a new group, returning self for chaining.

Source

pub fn rescale(&self, timestamp: Timestamp) -> Result<Timestamp>

timestamp at this track’s timescale.

A track is all timed or all scale-less, so a frame must match it: a scaled timestamp on a scale-less track, or an unscaled one on a timed track, is Error::TimestampMismatch, as is a timestamp the track’s scale can’t hold. A writer that changes state before its frame reaches the track, such as signing or encrypting it, rescales first so a refused timestamp changes nothing.

Source

pub fn rescale_in(&self, timestamp: Timestamp, key: u64) -> Result<Timestamp>

Self::rescale for a frame of group key: a scale-less track’s frame carries its group’s key, so any other is Error::TimestampMismatch. A writer that changes state before its frame reaches the group checks this first, as with Self::rescale.

Trait Implementations§

Source§

impl Clone for Info

Source§

fn clone(&self) -> Self

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 Info

Source§

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

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

impl Default for Info

An authored track’s defaults: untimed, a zero max_age (the live edge only), priority 0, uncompressed, never asking for a refresh.

Source§

fn default() -> Self

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

impl Eq for Info

Source§

impl From<Info> for Listed

Source§

fn from(info: Info) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Info

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Info

Auto Trait Implementations§

§

impl Freeze for Info

§

impl RefUnwindSafe for Info

§

impl Send for Info

§

impl Sync for Info

§

impl Unpin for Info

§

impl UnsafeUnpin for Info

§

impl UnwindSafe for Info

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
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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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