pub struct ResumeTracker {
last_position: Option<f64>,
attempts: u32,
}Expand description
Budget for consecutive resume attempts that make no progress.
Held by the player controller across ends of the same stream. Any position
change larger than RESUME_PROGRESS_EPSILON_SECS — the resume played on,
or a different item was loaded — is a fresh context and refills the budget.
Fields§
§last_position: Option<f64>§attempts: u32Implementations§
Source§impl ResumeTracker
impl ResumeTracker
Sourcepub fn allow_attempt(&mut self, position: f64) -> Option<u32>
pub fn allow_attempt(&mut self, position: f64) -> Option<u32>
Record an attempt at position, returning its 1-based number — or None
once the budget is spent. Callers use the number to back off: a stream
that failed twice at the same spot is waiting on something slower than an
immediate retry can outrun.
Trait Implementations§
Source§impl Debug for ResumeTracker
impl Debug for ResumeTracker
Source§impl Default for ResumeTracker
impl Default for ResumeTracker
Source§fn default() -> ResumeTracker
fn default() -> ResumeTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ResumeTracker
impl RefUnwindSafe for ResumeTracker
impl Send for ResumeTracker
impl Sync for ResumeTracker
impl Unpin for ResumeTracker
impl UnsafeUnpin for ResumeTracker
impl UnwindSafe for ResumeTracker
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.