Struct aspasia::PlainSubtitle

source ·
pub struct PlainSubtitle { /* private fields */ }
Expand description

Basic subtitle data containing only the textual content and start/end timing with no style or formatting information

Implementations§

source§

impl PlainSubtitle

source

pub fn new() -> Self

Create empty instance of PlainSubtitle

source

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

Create new instance using a list of already defined PlainEvents

source

pub fn events(&self) -> &[PlainEvent]

Get list of events as a slice

source

pub fn events_mut(&mut self) -> &mut [PlainEvent]

Get list of events as a mutable slice

source

pub fn event(&self, index: usize) -> Option<&PlainEvent>

Retrieve event at index

source

pub fn event_mut(&mut self, index: usize) -> Option<&mut PlainEvent>

Get mutable event at index

Trait Implementations§

source§

impl Clone for PlainSubtitle

source§

fn clone(&self) -> PlainSubtitle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PlainSubtitle

source§

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

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

impl Default for PlainSubtitle

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T: TimedSubtitle + TextSubtitle> From<&T> for PlainSubtitle

source§

fn from(value: &T) -> Self

Convert from any implementor of TimedSubtitle and TextSubtitle. This strips all formatting tags from the text.

source§

impl From<PlainSubtitle> for AssSubtitle

source§

fn from(value: PlainSubtitle) -> Self

Converts to this type from the input type.
source§

impl From<PlainSubtitle> for SsaSubtitle

source§

fn from(value: PlainSubtitle) -> Self

Converts to this type from the input type.
source§

impl From<PlainSubtitle> for SubRipSubtitle

source§

fn from(value: PlainSubtitle) -> Self

Converts to this type from the input type.
source§

impl From<PlainSubtitle> for WebVttSubtitle

source§

fn from(value: PlainSubtitle) -> Self

Converts to this type from the input type.
source§

impl From<TimedSubtitleFile> for PlainSubtitle

source§

fn from(value: TimedSubtitleFile) -> Self

Converts to this type from the input type.

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.