SrtFormat

Struct SrtFormat 

Source
pub struct SrtFormat { /* private fields */ }
Available on crate feature std only.
Expand description

SRT format handler with style preservation

Implementations§

Source§

impl SrtFormat

Source

pub fn new() -> Self

Create a new SRT format handler

Trait Implementations§

Source§

impl Debug for SrtFormat

Source§

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

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

impl Default for SrtFormat

Source§

fn default() -> Self

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

impl Format for SrtFormat

Source§

fn as_importer(&self) -> &dyn FormatImporter

Get self as an importer (workaround for trait upcasting)
Source§

fn as_exporter(&self) -> &dyn FormatExporter

Get self as an exporter (workaround for trait upcasting)
Source§

fn name(&self) -> &str

Get the format name
Source§

fn supports_extension(&self, extension: &str) -> bool

Check if this format supports the given file extension
Source§

impl FormatExporter for SrtFormat

Source§

fn format_info(&self) -> &FormatInfo

Get information about this format
Source§

fn export_to_writer( &self, document: &EditorDocument, writer: &mut dyn Write, options: &FormatOptions, ) -> Result<FormatResult, EditorError>

Export to a writer with the given options
Source§

fn can_export(&self, extension: &str) -> bool

Check if this exporter can handle the given file extension
Source§

fn export_to_path( &self, document: &EditorDocument, path: &Path, options: &FormatOptions, ) -> Result<FormatResult, EditorError>

Export to a file path
Source§

fn export_to_string( &self, document: &EditorDocument, options: &FormatOptions, ) -> Result<(String, FormatResult), EditorError>

Export to a string
Source§

impl FormatImporter for SrtFormat

Source§

fn format_info(&self) -> &FormatInfo

Get information about this format
Source§

fn import_from_reader( &self, reader: &mut dyn Read, options: &FormatOptions, ) -> Result<(EditorDocument, FormatResult), EditorError>

Import from a reader with the given options
Source§

fn can_import(&self, extension: &str) -> bool

Check if this importer can handle the given file extension
Source§

fn import_from_path( &self, path: &Path, options: &FormatOptions, ) -> Result<(EditorDocument, FormatResult), EditorError>

Import from a file path
Source§

fn import_from_string( &self, content: &str, options: &FormatOptions, ) -> Result<(EditorDocument, FormatResult), EditorError>

Import from a string

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.