pub struct TcSpan {
pub tc_in: Timecode,
pub tc_out: Timecode,
}Expand description
A timecode span defined by an in-point and an out-point.
Fields§
§tc_in: TimecodeThe in-point timecode.
tc_out: TimecodeThe out-point timecode.
Implementations§
Source§impl TcSpan
impl TcSpan
Sourcepub fn new(tc_in: Timecode, tc_out: Timecode) -> Result<Self, TimecodeError>
pub fn new(tc_in: Timecode, tc_out: Timecode) -> Result<Self, TimecodeError>
Creates a new span. tc_in must not be after tc_out.
Sourcepub fn duration_frames(&self) -> u64
pub fn duration_frames(&self) -> u64
Returns the duration of the span in frames.
Sourcepub fn duration_seconds(&self, frame_rate: FrameRate) -> f64
pub fn duration_seconds(&self, frame_rate: FrameRate) -> f64
Returns the duration in seconds.
Sourcepub fn contains(&self, tc: &Timecode) -> bool
pub fn contains(&self, tc: &Timecode) -> bool
Checks whether a timecode falls within this span (inclusive).
Sourcepub fn intersection(
&self,
other: &TcSpan,
frame_rate: FrameRate,
) -> Option<Result<TcSpan, TimecodeError>>
pub fn intersection( &self, other: &TcSpan, frame_rate: FrameRate, ) -> Option<Result<TcSpan, TimecodeError>>
Returns the intersection of two spans, or None if they don’t overlap.
Trait Implementations§
impl Copy for TcSpan
impl StructuralPartialEq for TcSpan
Auto Trait Implementations§
impl Freeze for TcSpan
impl RefUnwindSafe for TcSpan
impl Send for TcSpan
impl Sync for TcSpan
impl Unpin for TcSpan
impl UnsafeUnpin for TcSpan
impl UnwindSafe for TcSpan
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