[−][src]Enum subparse::SubtitleFile
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)
Methods
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]
fn clone(&self) -> SubtitleFile[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl From<SrtFile> for SubtitleFile[src]
fn from(f: SrtFile) -> SubtitleFile[src]
impl From<SsaFile> for SubtitleFile[src]
fn from(f: SsaFile) -> SubtitleFile[src]
impl From<IdxFile> for SubtitleFile[src]
fn from(f: IdxFile) -> SubtitleFile[src]
impl From<VobFile> for SubtitleFile[src]
fn from(f: VobFile) -> SubtitleFile[src]
impl From<MdvdFile> for SubtitleFile[src]
fn from(f: MdvdFile) -> SubtitleFile[src]
impl Debug for SubtitleFile[src]
Auto Trait Implementations
impl Sync for SubtitleFile
impl Send for SubtitleFile
impl Unpin for SubtitleFile
impl RefUnwindSafe for SubtitleFile
impl UnwindSafe for SubtitleFile
Blanket Implementations
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,