Trait SectionProcessor

Source
pub trait SectionProcessor: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn process(&self, header: &str, lines: &[&str]) -> SectionResult;

    // Provided method
    fn validate(&self, header: &str, lines: &[&str]) -> bool { ... }
}
Available on crate feature plugins only.
Expand description

Trait for handling custom ASS sections

Implementors can process non-standard sections that extend ASS functionality. Section processors are called when unknown section headers are encountered.

Required Methods§

Source

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

Unique name identifier for this section processor

Source

fn process(&self, header: &str, lines: &[&str]) -> SectionResult

Process section header and content lines

§Arguments
  • header - Section header (e.g., “Aegisub Project”)
  • lines - All lines belonging to this section
§Returns
  • SectionResult::Processed - Section was handled successfully
  • SectionResult::Ignored - Section not recognized by this processor
  • SectionResult::Failed - Error occurred during processing

Provided Methods§

Source

fn validate(&self, header: &str, lines: &[&str]) -> bool

Optional validation of section format

Implementors§