pub struct PlaybackMap {
pub positions_watched: Vec<bool>,
}Expand description
A boolean map of 1-second content buckets indicating which positions were watched during a session.
Fields§
§positions_watched: Vec<bool>One bool per second of content (true = watched).
Implementations§
Source§impl PlaybackMap
impl PlaybackMap
Sourcepub fn mark_range(&mut self, start_ms: u64, end_ms: u64)
pub fn mark_range(&mut self, start_ms: u64, end_ms: u64)
Mark every second in [start_ms, end_ms) as watched.
Sourcepub fn coverage_pct(&self, total_ms: u64) -> f32
pub fn coverage_pct(&self, total_ms: u64) -> f32
Fraction of the content that was watched (0.0 – 1.0).
Trait Implementations§
Source§impl Clone for PlaybackMap
impl Clone for PlaybackMap
Source§fn clone(&self) -> PlaybackMap
fn clone(&self) -> PlaybackMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PlaybackMap
impl RefUnwindSafe for PlaybackMap
impl Send for PlaybackMap
impl Sync for PlaybackMap
impl Unpin for PlaybackMap
impl UnsafeUnpin for PlaybackMap
impl UnwindSafe for PlaybackMap
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more