Skip to main content

Module ass

Module ass 

Source
Expand description

Advanced SubStation Alpha (ASS/SSA) subtitle format implementation.

This module provides parsing, serialization, and detection capabilities for the ASS/SSA subtitle format, including style and color definitions.

Implementation is split across the following submodules:

  • parser: pure parsing from &str into Subtitle.
  • serializer: pure serialization from Subtitle back to ASS text.
  • time: timestamp parsing/formatting helpers.
  • tests (test-only): co-located unit tests for the format.

AssStyle and Color style descriptors are kept here in mod.rs because they are small data structures shared across this module.

§Examples

use subx_cli::core::formats::{SubtitleFormat, ass::AssFormat};
let ass = AssFormat;
let content = "[Events]\nFormat: Layer,Start,End,Style,Name,MarginL,MarginR,MarginV,Effect,Text\nDialogue: 0,0:00:01.00,0:00:02.50,Default,,0000,0000,0000,,Hello";
let subtitle = ass.parse(content).unwrap();

Structs§

AssFormat
Subtitle format implementation for ASS/SSA.
AssStyle
ASS style definition for subtitle entries.
Color
ASS color structure for style entries.