pub struct SubtitleCue {
pub id: u32,
pub tc_in: Timecode,
pub tc_out: Timecode,
pub text: String,
}Expand description
A single subtitle cue with in/out timecodes.
Fields§
§id: u32Cue identifier (sequential number or label).
tc_in: TimecodeStart timecode.
tc_out: TimecodeEnd timecode.
text: StringText content of the cue.
Implementations§
Source§impl SubtitleCue
impl SubtitleCue
Sourcepub fn new(id: u32, tc_in: Timecode, tc_out: Timecode, text: String) -> Self
pub fn new(id: u32, tc_in: Timecode, tc_out: Timecode, text: String) -> Self
Create a new subtitle cue.
Sourcepub fn duration_frames(&self) -> u64
pub fn duration_frames(&self) -> u64
Duration of this cue in frames.
Sourcepub fn duration_secs(&self) -> f64
pub fn duration_secs(&self) -> f64
Duration of this cue in seconds (approximate for non-integer rates).
Sourcepub fn overlaps(&self, other: &SubtitleCue) -> bool
pub fn overlaps(&self, other: &SubtitleCue) -> bool
Check if this cue overlaps another cue.
Trait Implementations§
Source§impl Clone for SubtitleCue
impl Clone for SubtitleCue
Source§fn clone(&self) -> SubtitleCue
fn clone(&self) -> SubtitleCue
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 SubtitleCue
impl Debug for SubtitleCue
Source§impl PartialEq for SubtitleCue
impl PartialEq for SubtitleCue
impl StructuralPartialEq for SubtitleCue
Auto Trait Implementations§
impl Freeze for SubtitleCue
impl RefUnwindSafe for SubtitleCue
impl Send for SubtitleCue
impl Sync for SubtitleCue
impl Unpin for SubtitleCue
impl UnsafeUnpin for SubtitleCue
impl UnwindSafe for SubtitleCue
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