Available on crate feature
stream only.Expand description
Streaming and incremental parsing for ASS scripts
Provides efficient streaming parsing capabilities with true incremental processing through state machine design. Enables <5ms responsiveness for large files and editor integration.
§Features
- True streaming: Process chunks without loading entire file
- State machine: Handle partial lines and incomplete sections
- Delta tracking: Efficient change representation for editors
- Memory efficiency: O(line) not O(file) memory usage
§Performance
- Target: <5ms per 1MB chunk processing
- Memory: <1.1x input size peak usage
- Incremental: <2ms for single-event edits
- Supports files up to 2GB on 64-bit systems
§Example
use ass_core::parser::streaming::StreamingParser;
let mut parser = StreamingParser::new();
// Process chunks incrementally
let chunk1 = b"[Script Info]\nTitle: Example\n";
let deltas1 = parser.feed_chunk(chunk1)?;
let chunk2 = b"[Events]\nFormat: Layer, Start, End\n";
let deltas2 = parser.feed_chunk(chunk2)?;
let result = parser.finish()?;Structs§
- Delta
Batch - Collection of parse deltas with batch operations
- Line
Processor - Line processor for streaming ASS parser
- Streaming
Context - Context for streaming parser state
- Streaming
Parser - High-performance streaming parser for ASS scripts
- Streaming
Result - Result of streaming parser containing owned sections
Enums§
- Parse
Delta - Delta operations for streaming updates
- Parser
State - Streaming parser state for incremental processing
- Section
Kind - Section types for state tracking
Functions§
- build_
modified_ source - Build modified source with range replacement