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§
Sourcefn process(
&self,
srt: SubRipFile,
language: Option<&str>,
) -> Result<(SubRipFile, bool), SubtitleError>
fn process( &self, srt: SubRipFile, language: Option<&str>, ) -> Result<(SubRipFile, bool), SubtitleError>
Processes a SubRipFile and reports whether the output changed.
Provided Methods§
Sourcefn from_srt(
&self,
srt: SubRipFile,
language: Option<&str>,
) -> Result<(SubRipFile, bool), SubtitleError>
fn from_srt( &self, srt: SubRipFile, language: Option<&str>, ) -> Result<(SubRipFile, bool), SubtitleError>
Applies subtitle cleanup or transformation passes to SubRipFile values.
Sourcefn from_file<P: AsRef<Path>>(
&self,
file: P,
language: Option<&str>,
) -> Result<(SubRipFile, bool), SubtitleError>
fn from_file<P: AsRef<Path>>( &self, file: P, language: Option<&str>, ) -> Result<(SubRipFile, bool), SubtitleError>
Reads an SRT file and processes it synchronously.
Sourcefn from_string(
&self,
data: &str,
language: Option<&str>,
) -> Result<(SubRipFile, bool), SubtitleError>
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".