1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use crateAnyResult;
use Subtitle;
/// Trait for streaming subtitle parsers.
///
/// Provides a unified interface for incremental parsing of subtitle files,
/// useful for large files or memory-constrained environments.
///
/// # Example
///
/// ```no_run
/// use subtitler::model::StreamingParser;
///
/// # fn main() -> anyhow::Result<()> {
/// let content = "1\n00:00:01,000 --> 00:00:03,500\nHello\n\n";
/// let mut parser = subtitler::srt::parse_stream(content);
///
/// while let Some(result) = parser.next() {
/// let subtitle = result?;
/// println!("{:?}", subtitle);
/// }
/// # Ok(())
/// # }
/// ```