pub struct SubtitleEntry {
pub text: String,
pub start_ms: u64,
pub end_ms: u64,
pub anchor: SubtitleAnchor,
pub font: Option<SubtitleFont>,
pub margin_px: u32,
}Expand description
A single subtitle entry with text, timing, and style.
Fields§
§text: StringSubtitle text (may contain newlines for multi-line).
start_ms: u64Start time in milliseconds.
end_ms: u64End time in milliseconds.
anchor: SubtitleAnchorPosition anchor.
font: Option<SubtitleFont>Font style override (uses config default if None).
margin_px: u32Margin from the frame edge in pixels.
Implementations§
Source§impl SubtitleEntry
impl SubtitleEntry
Sourcepub fn new(text: impl Into<String>, start_ms: u64, end_ms: u64) -> Self
pub fn new(text: impl Into<String>, start_ms: u64, end_ms: u64) -> Self
Creates a new subtitle entry.
Sourcepub fn with_anchor(self, anchor: SubtitleAnchor) -> Self
pub fn with_anchor(self, anchor: SubtitleAnchor) -> Self
Sets the position anchor.
Sourcepub fn with_font(self, font: SubtitleFont) -> Self
pub fn with_font(self, font: SubtitleFont) -> Self
Sets a font override for this entry.
Sourcepub fn duration_ms(&self) -> u64
pub fn duration_ms(&self) -> u64
Returns the duration of this subtitle entry in milliseconds.
Sourcepub fn is_active_at(&self, timestamp_ms: u64) -> bool
pub fn is_active_at(&self, timestamp_ms: u64) -> bool
Returns true if this subtitle is active at the given timestamp.
Trait Implementations§
Source§impl Clone for SubtitleEntry
impl Clone for SubtitleEntry
Source§fn clone(&self) -> SubtitleEntry
fn clone(&self) -> SubtitleEntry
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 moreAuto Trait Implementations§
impl Freeze for SubtitleEntry
impl RefUnwindSafe for SubtitleEntry
impl Send for SubtitleEntry
impl Sync for SubtitleEntry
impl Unpin for SubtitleEntry
impl UnsafeUnpin for SubtitleEntry
impl UnwindSafe for SubtitleEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more