Enum subparse::SubtitleFile[][src]

pub enum SubtitleFile {
    SubRipFile(SrtFile),
    SubStationAlpha(SsaFile),
    VobSubIdxFile(IdxFile),
    VobSubSubFile(VobFile),
    MicroDVDFile(MdvdFile),
}

Unified wrapper around the all individual subtitle file types.

Variants

SubRipFile(SrtFile)

.srt file

SubStationAlpha(SsaFile)

.ssa/.ass file

VobSubIdxFile(IdxFile)

.idx file

VobSubSubFile(VobFile)

.sub file (VobSub/binary)

MicroDVDFile(MdvdFile)

.sub file (MicroDVD/text)

Implementations

impl SubtitleFile[src]

pub fn get_subtitle_entries(&self) -> Result<Vec<SubtitleEntry>>[src]

The subtitle entries can be changed by calling update_subtitle_entries().

pub fn update_subtitle_entries(&mut self, i: &[SubtitleEntry]) -> Result<()>[src]

Set the entries from the subtitle entries from the get_subtitle_entries().

The length of the given input slice should always match the length of the vector length from get_subtitle_entries(). This function can not delete/create new entries, but preserves everything else in the file (formatting, authors, …).

If the input entry has entry.line == None, the line will not be overwritten.

Be aware that .idx files cannot save time_spans_ (a subtitle will be shown between two consecutive timepoints/there are no separate starts and ends) - so the timepoint will be set to the start of the corresponding input-timespan.

pub fn to_data(&self) -> Result<Vec<u8>>[src]

Returns a byte-stream in the respective format (.ssa, .srt, etc.) with the (probably) altered information.

Trait Implementations

impl Clone for SubtitleFile[src]

impl Debug for SubtitleFile[src]

impl From<IdxFile> for SubtitleFile[src]

impl From<MdvdFile> for SubtitleFile[src]

impl From<SrtFile> for SubtitleFile[src]

impl From<SsaFile> for SubtitleFile[src]

impl From<VobFile> for SubtitleFile[src]

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<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.