#[non_exhaustive]pub struct Info {
pub timescale: Timescale,
pub max_age: Duration,
pub priority: u8,
}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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.timescale: TimescaleUnits per second for per-frame timestamps on this track.
Every track is timed; this defaults to Timescale::MILLI. On Lite05+ it is
reported in TRACK_INFO and the publisher zigzag-delta encodes per-frame
timestamps at this scale on the wire. Protocols whose wire can’t carry it
(pre-Lite05 moq-lite, IETF moq-transport) fall back to local monotonic milliseconds.
max_age: DurationHow far behind the live edge a group may fall, in media timestamps, before it is stale. The newest group is always retained.
A retention bound rather than a delivery one, the inverse of an HTTP
Cache-Control: max-age. Subscription::max_age is clamped to this, since a
group can’t be waited for longer than it’s kept around. Reported in TRACK_INFO so
relays re-serve with the same window. Defaults to DEFAULT_MAX_AGE.
Measured against timestamps rather than the wall clock, so a congestion stall
(timestamps stop advancing) can’t age content out. Wall-clock reclamation of
content nobody is accessing belongs to the cache pool’s own
expiry window, not to this budget.
This is the Publisher Max Age on the wire, the publisher-side half of the
budget Subscription::max_age sets for a subscriber.
Encoded as milliseconds in a QUIC varint, so a duration of 2^62 milliseconds
or more cannot be put on the wire. Sub-millisecond precision is truncated
(Duration::as_millis) at encode time.
priority: u8The publisher’s priority for this track, used only to break ties between subscriptions of equal subscriber priority. Reported in TRACK_INFO (Lite05+). Higher is more urgent. Defaults to 127, the midpoint.
Implementations§
Source§impl Info
impl Info
Sourcepub fn with_timescale(self, timescale: Timescale) -> Self
pub fn with_timescale(self, timescale: Timescale) -> Self
Set the per-frame timestamp scale, returning self for chaining.
Defaults to Timescale::MILLI. On Lite05+ this scale is reported in TRACK_INFO
and used to encode per-frame timestamps on the wire.
Sourcepub fn with_max_age(self, max_age: Duration) -> Self
pub fn with_max_age(self, max_age: Duration) -> Self
Set how old a non-latest group may get before eviction, returning self for chaining.
Sourcepub fn with_priority(self, priority: u8) -> Self
pub fn with_priority(self, priority: u8) -> Self
Set the publisher’s tie-break priority, returning self for chaining.