pub struct MicroDvdSubtitle { /* private fields */ }
Expand description

Unmodified MicroDVD subtitle, with events timed in terms of frames.

This is not well supported, so things like conversion are not implemented for this type. If possible, use of MicroDvdSubtitle, which represents subtitle events using actual timestamps, is better supported.

Implementations§

source§

impl MicroDvdSubtitle

source

pub fn from_events(events: Vec<MicroDvdEvent>) -> Self

Create new instance from already existing list of MicroDvdEvents.

Trait Implementations§

source§

impl Debug for MicroDvdSubtitle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for MicroDvdSubtitle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&TimedMicroDvdSubtitle> for MicroDvdSubtitle

source§

fn from(value: &TimedMicroDvdSubtitle) -> Self

Converts to this type from the input type.
source§

impl FromStr for MicroDvdSubtitle

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Subtitle for MicroDvdSubtitle

§

type Event = MicroDvdEvent

Event type for the given subtitle format
source§

fn from_path_with_encoding( path: impl AsRef<Path>, encoding: Option<&'static Encoding> ) -> Result<Self, Error>

Load subtitle format from path using the given encoding Read more
source§

fn events(&self) -> &[Self::Event]

Get list of events as a slice
source§

fn events_mut(&mut self) -> &mut [Self::Event]

Get list of events as a mutable slice
source§

fn from_path(path: impl AsRef<Path>) -> Result<Self, Error>

Load subtitle from given path. Automatically attempts to detect the encoding to use from the file contents. Read more
source§

fn event(&self, index: usize) -> Option<&Self::Event>

Try to get event at given index
source§

fn event_mut(&mut self, index: usize) -> Option<&mut Self::Event>

Try to get mutable event at given index
source§

fn export(&self, path: impl AsRef<Path>) -> Result<(), Error>

Write subtitles to file at the given path Read more
source§

impl TextSubtitle for MicroDvdSubtitle

source§

fn strip_formatting(&mut self)

Remove all styling/formatting information from the text and subtitle metadata

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.