pub struct Delay {
pub min: Option<Duration>,
pub max: Option<Duration>,
}Expand description
How far behind the live edge a media reader plays: where it starts, and how late it may fall.
The default states no minimum and a zero maximum, which reaches back as far as the max allows and skips a superseded group at once.
Fields§
§min: Option<Duration>The playout delay held behind the live edge, or None when the reader did not state one.
Each subscription range starting at Start::Oldest
joins live this far behind the live edge instead, as a
Start::Live min, so a player’s buffer arrives full; a
range with a time start keeps it. Unstated, the join reaches back as far as Self::max
allows. A reader also keeps the group covering the live edge less this as it starts,
reading an unstated one as zero. A missing group is given up by Self::max alone,
whatever the minimum.
max: Option<Duration>How long a superseded group stays worth delivering, or None for as long as the publisher
keeps it: each live join’s Start::Live max. With no
Self::min either, a range starting at the oldest group stays history, delivered in full.
Implementations§
Source§impl Delay
impl Delay
Sourcepub fn with_min(self, min: impl Into<Option<Duration>>) -> Self
pub fn with_min(self, min: impl Into<Option<Duration>>) -> Self
Set Self::min, returning self for chaining.
Sourcepub fn with_max(self, max: impl Into<Option<Duration>>) -> Self
pub fn with_max(self, max: impl Into<Option<Duration>>) -> Self
Set Self::max, returning self for chaining.
Sourcepub fn subscription(&self, subscription: Subscription) -> Subscription
pub fn subscription(&self, subscription: Subscription) -> Subscription
subscription at this delay: each range starting at the oldest group joins live
Self::min behind the live edge, or Self::max when only that is stated, and each
live join takes Self::max as its own. A time start stays history.
Subscription::default is already a live join,
at the latest group, so a range this delay should place starts at
Range::ALL instead.
Sourcepub fn update(
&self,
current: &Subscription,
subscription: Subscription,
) -> Subscription
pub fn update( &self, current: &Subscription, subscription: Subscription, ) -> Subscription
Self::subscription as an update to current, the subscription it replaces: a range
starting at the oldest group that current already joins live with the same end keeps
that join’s min and takes the new Self::max, so changing Self::min places only
the ranges it adds. A live join that already resolved stays where it started, as
Consumer::set_delay leaves it.
Trait Implementations§
impl Copy for Delay
impl Eq for Delay
impl StructuralPartialEq for Delay
Auto Trait Implementations§
impl Freeze for Delay
impl RefUnwindSafe for Delay
impl Send for Delay
impl Sync for Delay
impl Unpin for Delay
impl UnsafeUnpin for Delay
impl UnwindSafe for Delay
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> 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.