pub struct Transcript {
pub schema: String,
pub source_blake3: String,
pub language: String,
pub duration_ms: u64,
pub words: Vec<Word>,
pub vad: Vec<Span>,
pub model: ModelRef,
}Fields§
§schema: String§source_blake3: StringBLAKE3 (or other stable id) of the source this transcript describes. Empty when the producer has no registered source (SRT import, TTS).
language: StringBCP-47 language tag, e.g. “en”.
duration_ms: u64Source audio duration in milliseconds.
words: Vec<Word>§vad: Vec<Span>Voice-activity segments (speech present), sorted, non-overlapping.
model: ModelRefImplementations§
Source§impl Transcript
impl Transcript
Sourcepub fn from_words(
words: &[TimedWord],
language: &str,
duration_ms: Option<u64>,
model: ModelRef,
end_source: EndSource,
) -> Self
pub fn from_words( words: &[TimedWord], language: &str, duration_ms: Option<u64>, model: ModelRef, end_source: EndSource, ) -> Self
Build from timed words; duration_ms is the last word end unless given.
pub fn timed_words(&self) -> Vec<TimedWord>
pub fn validate(&self) -> Result<(), TranscriptError>
pub fn to_json(&self) -> String
Sourcepub fn from_json(s: &str) -> Result<Self, TranscriptError>
pub fn from_json(s: &str) -> Result<Self, TranscriptError>
Parse and validate. Accepts the legacy CutRight schema id.
Trait Implementations§
Source§impl Clone for Transcript
impl Clone for Transcript
Source§impl Debug for Transcript
impl Debug for Transcript
Source§impl<'de> Deserialize<'de> for Transcript
impl<'de> Deserialize<'de> for Transcript
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
Source§impl PartialEq for Transcript
impl PartialEq for Transcript
Source§impl Serialize for Transcript
impl Serialize for Transcript
impl StructuralPartialEq for Transcript
Auto Trait Implementations§
impl Freeze for Transcript
impl RefUnwindSafe for Transcript
impl Send for Transcript
impl Sync for Transcript
impl Unpin for Transcript
impl UnsafeUnpin for Transcript
impl UnwindSafe for Transcript
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