pub struct CaptionBlock {
pub id: u32,
pub start_ms: u64,
pub end_ms: u64,
pub lines: Vec<String>,
pub speaker_id: Option<u8>,
pub position: CaptionPosition,
}Expand description
A fully resolved caption block ready for rendering or export.
Fields§
§id: u32Sequential 1-based identifier.
start_ms: u64§end_ms: u64§lines: Vec<String>Lines of text; at most max_lines entries.
speaker_id: Option<u8>§position: CaptionPositionImplementations§
Source§impl CaptionBlock
impl CaptionBlock
Sourcepub fn char_count(&self) -> usize
pub fn char_count(&self) -> usize
Total number of characters across all lines (excluding newlines).
Sourcepub fn duration_ms(&self) -> u64
pub fn duration_ms(&self) -> u64
Duration of this block in milliseconds.
Trait Implementations§
Source§impl Clone for CaptionBlock
impl Clone for CaptionBlock
Source§fn clone(&self) -> CaptionBlock
fn clone(&self) -> CaptionBlock
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 CaptionBlock
impl Debug for CaptionBlock
Source§impl PartialEq for CaptionBlock
impl PartialEq for CaptionBlock
impl StructuralPartialEq for CaptionBlock
Auto Trait Implementations§
impl Freeze for CaptionBlock
impl RefUnwindSafe for CaptionBlock
impl Send for CaptionBlock
impl Sync for CaptionBlock
impl Unpin for CaptionBlock
impl UnsafeUnpin for CaptionBlock
impl UnwindSafe for CaptionBlock
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