pub struct TranscriptSegment { /* private fields */ }Implementations§
Source§impl TranscriptSegment
impl TranscriptSegment
pub fn new( text: impl Into<String>, span: Option<Range<u64>>, ) -> Result<Self, TranscriptionError>
pub fn as_str(&self) -> &str
Sourcepub fn span(&self) -> Option<Range<u64>>
pub fn span(&self) -> Option<Range<u64>>
Where the segment’s audio sits in its recording, when word timestamps pin it. Lets a caller measure the silence between two segments.
Sourcepub fn word_spans(&self) -> Option<&[Range<u64>]>
pub fn word_spans(&self) -> Option<&[Range<u64>]>
Where each word sits, in order, when every word was timed.
pub fn source_window(&self) -> Option<Range<u64>>
pub fn with_source_window( self, window: Range<u64>, ) -> Result<Self, TranscriptionError>
pub fn with_word_spans( self, words: Vec<Range<u64>>, ) -> Result<Self, TranscriptionError>
pub fn bounded(self, audio_end: u64) -> Result<Self, TranscriptionError>
pub fn into_text(self) -> String
Trait Implementations§
Source§impl Clone for TranscriptSegment
impl Clone for TranscriptSegment
Auto Trait Implementations§
impl Freeze for TranscriptSegment
impl RefUnwindSafe for TranscriptSegment
impl Send for TranscriptSegment
impl Sync for TranscriptSegment
impl Unpin for TranscriptSegment
impl UnsafeUnpin for TranscriptSegment
impl UnwindSafe for TranscriptSegment
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