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§
Sourcefn is_earlier_than(&self, other: &Self) -> bool
fn is_earlier_than(&self, other: &Self) -> bool
Return true if this timecode comes before other in time.
Sourcefn is_later_than(&self, other: &Self) -> bool
fn is_later_than(&self, other: &Self) -> bool
Return true if this timecode comes after other in time.
Sourcefn is_same_frame_as(&self, other: &Self) -> bool
fn is_same_frame_as(&self, other: &Self) -> bool
Return true if this timecode is identical to other (same frame count).
Sourcefn frames_distance(&self, other: &Self) -> u64
fn frames_distance(&self, other: &Self) -> u64
Return the absolute distance between two timecodes in frames.
Sourcefn clamp_to_range<'a>(&'a self, lo: &'a Self, hi: &'a Self) -> &'a Self
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.