[][src]Struct alass_util::TimeSpans

pub struct TimeSpans(pub Vec<SubTimeSpan>);

TimeSpan buffer to be used as reference by the synchronization process

May be generated from an AudioSink that's been processed for voice- activity, extracted from a subtitle file whose timing is known to be good, or populated manually by some other process (e.g. extracing embedded subs from video file). TimeSpans also provides functionality for reading and writing raw timespan data to/from disk which is useful for caching.

Methods

impl TimeSpans[src]

pub fn push(&mut self, span: SubTimeSpan)[src]

Appends a timespan

pub fn save(&self, filename: &str) -> Result<(), TimeSpansSaveError>[src]

Saves raw timespan data to disk

pub fn load(filename: &str) -> Result<Self, TimeSpansLoadError>[src]

Loads raw timespan data from disk

pub fn from_sub_file(sub_file: &SubtitleFile) -> Result<Self, SyncError>[src]

Create TimeSpans instance from subtitle file

pub fn to_alass_timespans(&self, interval: i64) -> Vec<TimeSpan>[src]

Convert TimeSpans from subparse to alass_core representation

Trait Implementations

impl<'_> From<&'_ VoiceActivity> for TimeSpans[src]

Analyze vector of voice-activity data and produce TimeSpans

impl IntoIterator for TimeSpans[src]

Allow for iteration over internal subparse::TimeSpan elements

type Item = SubTimeSpan

The type of the elements being iterated over.

type IntoIter = IntoIter<Self::Item>

Which kind of iterator are we turning this into?

impl<'_> TryFrom<&'_ [u8]> for TimeSpans[src]

Deserializes TimeSpans instance from raw bytes

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryInto<Vec<u8>> for &'a TimeSpans[src]

Serializes TimeSpans instance to raw bytes

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.