pub struct FormatManager { /* private fields */ }Expand description
Manager for subtitle format detection and parser dispatch.
The FormatManager handles format inference based on file contents
or extensions and routes parsing and serialization requests accordingly.
Implementations§
Source§impl FormatManager
impl FormatManager
Sourcepub fn parse_auto(&self, content: &str) -> Result<Subtitle>
pub fn parse_auto(&self, content: &str) -> Result<Subtitle>
Auto-detect format and parse
Sourcepub fn get_format(&self, name: &str) -> Option<&dyn SubtitleFormat>
pub fn get_format(&self, name: &str) -> Option<&dyn SubtitleFormat>
Get parser by format name
Sourcepub fn get_format_by_extension(&self, ext: &str) -> Option<&dyn SubtitleFormat>
pub fn get_format_by_extension(&self, ext: &str) -> Option<&dyn SubtitleFormat>
Get parser by file extension
Sourcepub fn read_subtitle_with_encoding_detection(
&self,
file_path: &str,
) -> Result<String>
pub fn read_subtitle_with_encoding_detection( &self, file_path: &str, ) -> Result<String>
Read subtitle and auto-detect encoding, convert to UTF-8
Sourcepub fn get_encoding_info(&self, file_path: &str) -> Result<EncodingInfo>
pub fn get_encoding_info(&self, file_path: &str) -> Result<EncodingInfo>
Get file encoding information
Sourcepub fn load_subtitle(&self, file_path: &Path) -> Result<Subtitle>
pub fn load_subtitle(&self, file_path: &Path) -> Result<Subtitle>
Load subtitle from file with encoding detection and parsing
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FormatManager
impl !RefUnwindSafe for FormatManager
impl !Send for FormatManager
impl !Sync for FormatManager
impl Unpin for FormatManager
impl !UnwindSafe for FormatManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more