pub struct SegmentStats {
pub total_segments: usize,
pub static_segments: usize,
pub total_frames: usize,
pub total_duration_cs: u64,
pub avg_frames_per_segment: f64,
pub avg_duration_cs: f64,
}Expand description
Compute statistics for a set of segments.
Fields§
§total_segments: usizeTotal number of segments.
static_segments: usizeNumber of static segments (all identical frames).
total_frames: usizeTotal number of frames.
total_duration_cs: u64Total duration in centiseconds.
avg_frames_per_segment: f64Average frames per segment.
avg_duration_cs: f64Average segment duration in centiseconds.
Implementations§
Source§impl SegmentStats
impl SegmentStats
Sourcepub fn from_segments(segments: &[Segment]) -> Self
pub fn from_segments(segments: &[Segment]) -> Self
Compute statistics from a list of segments.
Sourcepub fn total_duration_ms(&self) -> u64
pub fn total_duration_ms(&self) -> u64
Total duration in milliseconds.
Trait Implementations§
Source§impl Clone for SegmentStats
impl Clone for SegmentStats
Source§fn clone(&self) -> SegmentStats
fn clone(&self) -> SegmentStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SegmentStats
impl Debug for SegmentStats
Source§impl Default for SegmentStats
impl Default for SegmentStats
Source§fn default() -> SegmentStats
fn default() -> SegmentStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SegmentStats
impl RefUnwindSafe for SegmentStats
impl Send for SegmentStats
impl Sync for SegmentStats
impl Unpin for SegmentStats
impl UnsafeUnpin for SegmentStats
impl UnwindSafe for SegmentStats
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