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§
Trait Implementations§
impl Copy for Start
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.
impl From<Start> for Range
Every group from where the start places it, following the live edge, at priority 0 newest first.
Source§impl Ord for Start
impl Ord for Start
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Start
impl PartialOrd for Start
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.