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