#[non_exhaustive]pub enum RetentionClass {
Timed,
Sparse,
}std only.Expand description
Which retention discipline a published entry follows once inside the
Trunk’s sample ring.
Named RetentionClass, not Retention — plan step 3e’s tiered hot/cold
archive policy (docs/superpowers/plans/2026-07-26-media-plane-implementation.md)
owns the name Retention for an unrelated, later concept. This is the
orthogonal, in-ring question of “how eagerly can this entry be evicted”,
decided per TrunkWriter::publish call by whoever is feeding the
writer — it reflects a track’s nature (video/audio vs. an SCTE-35
section PID), not something intrinsic to a transmux::Sample itself,
so it is not a field the spec’s Sample type carries.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Timed
Regular-cadence media samples (audio, video, …): count-bounded, and
ordinary eviction is reported to a lagging SampleCursor as
SampleCursorItem::Lagged — a consumer that misses a video frame is
gapped, not wrong; it resumes from the next sample.
Sparse
Irregular, semantically-critical entries — an SCTE-35 splice cue, a subtitle sample — where losing one leaves a consumer’s derived state wrong, not merely gapped: a missed splice cue means splicing in the wrong place, or not at all.
§The retention rule
A Sparse entry lives in a ring bounded independently of the
Timed ring (TrunkConfig::sparse_capacity, separate from
TrunkConfig::timed_capacity). It is therefore never evicted
“merely because a time window rolled” on the unrelated Timed
class: no volume of video/audio publishes can push a still-live
splice cue out of the trunk, because Timed publishes never touch
the Sparse ring at all. A Sparse entry is only evicted once
Sparse publish volume itself exceeds the Sparse ring’s own
bound — and when that happens, SampleCursor::poll reports it as
SampleCursorItem::Degraded, not ordinary Lagged: a distinct,
stronger signal, because the consumer’s semantic state (e.g. “where
the next ad break splices”) is now wrong. A consumer that sees
Lagged should simply resume from the next sample; a consumer that
sees Degraded should treat its derived state as unsynchronised
until the next authoritative signal (a fresh cue, a manifest
reload) re-establishes it — resuming silently would splice on stale
information.
Trait Implementations§
Source§impl Clone for RetentionClass
impl Clone for RetentionClass
Source§fn clone(&self) -> RetentionClass
fn clone(&self) -> RetentionClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more