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
use crate::pending::TerminatorOptions;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FootnotesMode {
/// If footnotes are detected, treat the whole document as a single block.
SingleBlock,
/// Keep blocks but allow adapters to selectively re-parse via invalidation events.
///
/// Note: Invalidation support is planned post-MVP.
Invalidate,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ReferenceDefinitionsMode {
/// Keep blocks stable; reference definitions may be interpreted late by adapters.
StabilityFirst,
/// Emit invalidation events so adapters can selectively re-parse affected blocks.
///
/// Note: Invalidation support is planned post-MVP.
Invalidate,
}
#[derive(Debug, Clone)]
pub struct Options {
pub footnotes: FootnotesMode,
pub reference_definitions: ReferenceDefinitionsMode,
pub terminator: TerminatorOptions,
pub terminator_window_bytes: usize,
/// Optional hard cap for the internal buffer.
pub max_buffer_bytes: Option<usize>,
}
impl Default for Options {
fn default() -> Self {
Self {
footnotes: FootnotesMode::SingleBlock,
reference_definitions: ReferenceDefinitionsMode::StabilityFirst,
terminator: TerminatorOptions::default(),
terminator_window_bytes: 16 * 1024,
max_buffer_bytes: None,
}
}
}