Skip to main content

TimecodeCompare

Trait TimecodeCompare 

Source
pub trait TimecodeCompare: Sealed {
    // Required methods
    fn is_earlier_than(&self, other: &Self) -> bool;
    fn is_later_than(&self, other: &Self) -> bool;
    fn is_same_frame_as(&self, other: &Self) -> bool;
    fn frames_distance(&self, other: &Self) -> u64;
    fn clamp_to_range<'a>(&'a self, lo: &'a Self, hi: &'a Self) -> &'a Self;
}
Expand description

Extension trait adding named comparison helpers to Timecode.

The trait is sealed; it is only implemented for Timecode.

Required Methods§

Source

fn is_earlier_than(&self, other: &Self) -> bool

Return true if this timecode comes before other in time.

Source

fn is_later_than(&self, other: &Self) -> bool

Return true if this timecode comes after other in time.

Source

fn is_same_frame_as(&self, other: &Self) -> bool

Return true if this timecode is identical to other (same frame count).

Source

fn frames_distance(&self, other: &Self) -> u64

Return the absolute distance between two timecodes in frames.

Source

fn clamp_to_range<'a>(&'a self, lo: &'a Self, hi: &'a Self) -> &'a Self

Clamp self to the range [lo, hi] (inclusive, by frame count).

If lo > hi the result is lo.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§