pub struct TimedWord {
pub text: String,
pub start_ms: u64,
pub end_ms: u64,
pub source_ms: Option<(u64, u64)>,
}Expand description
One spoken word (end_ms exclusive).
Fields§
§text: String§start_ms: u64§end_ms: u64§source_ms: Option<(u64, u64)>Original source span (exclusive end), retained when output timing shifts. Consumers can derive stable cue ids from this span. Normalization may clamp output overlaps but leaves source spans unchanged.
Implementations§
Source§impl TimedWord
impl TimedWord
pub fn new(text: impl Into<String>, start_ms: u64, end_ms: u64) -> Self
Sourcepub fn from_seconds(text: impl Into<String>, start_s: f32, end_s: f32) -> Self
pub fn from_seconds(text: impl Into<String>, start_s: f32, end_s: f32) -> Self
From engine seconds. Negative or non-finite times clamp to 0; rounding
is to the nearest millisecond (the same rule as words_from_seconds).
Sourcepub fn start_secs(&self) -> f64
pub fn start_secs(&self) -> f64
Start in seconds.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TimedWord
impl<'de> Deserialize<'de> for TimedWord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TimedWord
impl StructuralPartialEq for TimedWord
Auto Trait Implementations§
impl Freeze for TimedWord
impl RefUnwindSafe for TimedWord
impl Send for TimedWord
impl Sync for TimedWord
impl Unpin for TimedWord
impl UnsafeUnpin for TimedWord
impl UnwindSafe for TimedWord
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