Skip to main content

Start

Enum Start 

Source
pub enum Start {
    Oldest,
    Time(u64),
    Live {
        min: Option<Duration>,
        max: Option<Duration>,
    },
}
Expand description

Where a Range starts.

This is the Start Anchor on the moq-lite wire.

Variants§

§

Oldest

The oldest group the publisher still holds: a floor for history, whose groups are delivered in full, bounded only by how long the publisher keeps them (Info::max_age).

§

Time(u64)

The group containing this time: the newest one starting at or before it, unless that group ended whole at or before the time (group::Producer::finish_at). A time past a whole group’s span lies in a pause no group contains, so the range starts at the next group. A floor for history, like Self::Oldest: its groups never go stale.

A time resolves at the hop that serves it, from the starts of the groups it holds. When none does, a hop whose Requests handler serves its history asks it for the group containing the time (see FillGroups::floor), reading nothing until it answers; otherwise, or when the handler can’t tell, it reaches back to the oldest group. While no group is held at all it waits for one, reading nothing of its range meanwhile. A relay’s copy that can’t tell which group contains a time asks its upstream and waits for the answer.

§

Live

A live join min behind the live edge, whose groups go stale max behind it.

Carried in whole milliseconds, rounded up. moq-lite before 07 and moq-transport cannot carry it, so it goes out as Self::Oldest there, under the subscription-wide max age those wires carry instead.

Fields

§min: Option<Duration>

How far behind the live edge to join: the group containing the live edge minus this lag, so a player’s buffer arrives full instead of filling in real time, and zero starts at the latest group. None sets no lag limit: the join reaches back past every group, taking each one max still allows.

The hop serving it measures the live edge in media time, from the newest frame it holds, rounded up to whole ticks, and on a scale-less track by arrival on its own clock. It resolves that time as a Self::Time start would, so a publisher looks it up in its history, then starts past any group there that max already expired. A relay’s copy forwards each join to its upstream as its own range and starts it where that range’s answer does. A range resolves once, so a live edge that moves later moves nothing already started.

§max: Option<Duration>

How long a superseded group stays worth delivering, measured from the live edge, or None for as long as the publisher keeps it.

Some(Duration::ZERO) skips immediately: group 8 arriving means group 7 is abandoned, timed or not. A larger budget tolerates that much reordering before giving up. This never adds delay, since the bound is only reached once newer data is already that far ahead. Read in order, None waits at a missing group until it resolves; see track::Ordered for where that can block. A max below min skips the join’s own oldest groups.

Changing only max on a range already live, with Subscriber::update, keeps where it joined, both here and upstream. Encoded as milliseconds in a QUIC varint, so a duration of 2^62 milliseconds or more goes out as no limit. Clamped to the publisher’s Info::max_age, since waiting for a group longer than it is kept around cannot produce it.

§Where it is enforced

At both ends, and neither alone is enough. The publisher skips a group that has aged out instead of putting it on the wire, which bounds a backlog before it costs bandwidth. But what reaches the publisher is the aggregate across every subscriber, resolved in favor of the most tolerant one, so that gate is only ever as tight as the most patient viewer. The subscriber applies its own budget again as it reads, where only its own ranges are in play.

This bounds a subscription. track::Consumer::fetch_group is exempt: it names one old group explicitly, so there is no live edge to be late against.

§How staleness is measured

By two clocks, and a group is stale once either reaches the budget. Both start at its immediate servable successor, so the newest group is stale only once it finished whole and the wall clock passed its arrival plus its span by the budget: the last group of a paused or finished track ages out too.

In presentation time, a group is measured by its reach, where its successor begins, against the newest frame of the latest group: it cannot present past its successor, so once everything it could still hold falls outside the budget it is provably useless. The candidate needs no timestamp of its own, so an empty or stalled group is bounded by its stamped successor the same way.

In wall-clock time, a group is measured by how long ago its successor arrived at this hop. That bounds what media time can’t: a peer whose timestamps stop advancing, a successor that never presents a frame, and an untimed track (pre-Lite05 moq-lite, or moq-transport without TIMESCALE), which is judged by the wall clock alone. A read waiting in a superseded group wakes at that deadline only when something collects the track’s cache pool: an origin’s driver does, and a standalone track needs Pool::poll called, as its idle expiry already does. Otherwise it is judged only when something else wakes the read.

Implementations§

Source§

impl Start

Source

pub const LATEST: Self

The latest group, skipping each the moment a newer one arrives: a live viewer holding no buffer.

Trait Implementations§

Source§

impl Clone for Start

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 Copy for Start

Source§

impl Debug for Start

Source§

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

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

impl Eq for Start

Source§

impl From<Start> for Range

Every group from where the start places it, following the live edge, at priority 0 newest first.

Source§

fn from(start: Start) -> Self

Converts to this type from the input type.
Source§

impl Hash for Start

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Start

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for Start

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 PartialOrd for Start

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for Start

Auto Trait Implementations§

§

impl Freeze for Start

§

impl RefUnwindSafe for Start

§

impl Send for Start

§

impl Sync for Start

§

impl Unpin for Start

§

impl UnsafeUnpin for Start

§

impl UnwindSafe for Start

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

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
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