Skip to main content

BaseProcessor

Trait BaseProcessor 

Source
pub trait BaseProcessor {
    // Required method
    fn process(
        &self,
        srt: SubRipFile,
        language: Option<&str>,
    ) -> Result<(SubRipFile, bool), SubtitleError>;

    // Provided methods
    fn from_srt(
        &self,
        srt: SubRipFile,
        language: Option<&str>,
    ) -> Result<(SubRipFile, bool), SubtitleError> { ... }
    fn from_file<P: AsRef<Path>>(
        &self,
        file: P,
        language: Option<&str>,
    ) -> Result<(SubRipFile, bool), SubtitleError> { ... }
    fn from_string(
        &self,
        data: &str,
        language: Option<&str>,
    ) -> Result<(SubRipFile, bool), SubtitleError> { ... }
}

Required Methods§

Source

fn process( &self, srt: SubRipFile, language: Option<&str>, ) -> Result<(SubRipFile, bool), SubtitleError>

Processes a SubRipFile and reports whether the output changed.

Provided Methods§

Source

fn from_srt( &self, srt: SubRipFile, language: Option<&str>, ) -> Result<(SubRipFile, bool), SubtitleError>

Applies subtitle cleanup or transformation passes to SubRipFile values.

Source

fn from_file<P: AsRef<Path>>( &self, file: P, language: Option<&str>, ) -> Result<(SubRipFile, bool), SubtitleError>

Reads an SRT file and processes it synchronously.

Source

fn from_string( &self, data: &str, language: Option<&str>, ) -> Result<(SubRipFile, bool), SubtitleError>

Parses an SRT string and processes it synchronously.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§