Trait SubtitleFormat

Source
pub trait SubtitleFormat {
    // Required methods
    fn parse(&self, content: &str) -> Result<Subtitle>;
    fn serialize(&self, subtitle: &Subtitle) -> Result<String>;
    fn detect(&self, content: &str) -> bool;
    fn format_name(&self) -> &'static str;
    fn file_extensions(&self) -> &'static [&'static str];
}
Expand description

字幕格式 Trait 定義

Required Methods§

Source

fn parse(&self, content: &str) -> Result<Subtitle>

解析字幕內容

Source

fn serialize(&self, subtitle: &Subtitle) -> Result<String>

序列化為字幕格式

Source

fn detect(&self, content: &str) -> bool

檢測是否為此格式

Source

fn format_name(&self) -> &'static str

格式名稱

Source

fn file_extensions(&self) -> &'static [&'static str]

支援的副檔名

Implementors§