ass_core/plugin/sections/aegisub/mod.rs
1//! Aegisub-specific section processors for ASS compatibility
2//!
3//! Implements section processors for Aegisub-specific sections that extend
4//! the standard ASS format. These processors handle project metadata and
5//! additional data storage used by the Aegisub subtitle editor.
6//!
7//! # Supported Sections
8//!
9//! - `[Aegisub Project]`: Project-specific metadata and settings
10//! - `[Aegisub Extradata]`: Additional data storage for extended functionality
11//!
12//! # Performance
13//!
14//! - Zero allocations for validation
15//! - O(n) processing where n = number of lines
16//! - Minimal memory footprint per processor
17
18mod processors;
19
20#[cfg(test)]
21mod tests;
22
23pub use processors::{AegisubExtradataProcessor, AegisubProjectProcessor};
24
25use crate::plugin::SectionProcessor;
26
27/// Create all Aegisub section processors
28///
29/// Returns a vector of boxed section processors for all Aegisub-specific sections.
30/// Useful for bulk registration with the extension registry.
31///
32/// # Example
33///
34/// ```rust
35/// use ass_core::plugin::{ExtensionRegistry, sections::aegisub::create_aegisub_processors};
36///
37/// let mut registry = ExtensionRegistry::new();
38/// for processor in create_aegisub_processors() {
39/// registry.register_section_processor(processor).unwrap();
40/// }
41/// ```
42#[must_use]
43pub fn create_aegisub_processors() -> alloc::vec::Vec<alloc::boxed::Box<dyn SectionProcessor>> {
44 alloc::vec![
45 alloc::boxed::Box::new(AegisubProjectProcessor),
46 alloc::boxed::Box::new(AegisubExtradataProcessor),
47 ]
48}