ass_editor/formats/srt/
format.rs1use crate::formats::{Format, FormatExporter, FormatImporter, FormatInfo};
8
9#[derive(Debug)]
11pub struct SrtFormat {
12 pub(super) info: FormatInfo,
13}
14
15impl SrtFormat {
16 pub fn new() -> Self {
18 Self {
19 info: FormatInfo {
20 name: "SRT".to_string(),
21 extensions: vec!["srt".to_string()],
22 mime_type: "text/srt".to_string(),
23 description: "SubRip subtitle format with style preservation".to_string(),
24 supports_styling: true,
25 supports_positioning: false,
26 },
27 }
28 }
29}
30
31impl Default for SrtFormat {
32 fn default() -> Self {
33 Self::new()
34 }
35}
36
37impl Format for SrtFormat {
38 fn as_importer(&self) -> &dyn FormatImporter {
39 self
40 }
41
42 fn as_exporter(&self) -> &dyn FormatExporter {
43 self
44 }
45}