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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Flat event representation of a parsed Ktav document.
//!
//! Replaces the recursive [`super::value::ThinValue`] tree on the typed
//! deserialization hot path. Each compound (`{...}`, `[...]`) is bracketed
//! by a `BeginObject`/`EndObject` or `BeginArray`/`EndArray` pair instead
//! of being its own boxed `BumpVec`.
//!
//! Why: a flat `BumpVec<Event<'a>>` lives in one contiguous slab — the
//! deserializer walks it with a single cursor, no per-compound bumpalo
//! allocation, no per-node enum-discriminant load behind a `Box`-style
//! indirection. Cache-friendly linear iteration vs. tree-pointer chasing.
//!
//! Dotted keys are *resolved at tokenize time* into synthetic
//! `Key`+`BeginObject`/.../`EndObject` triples, so the deserializer never
//! has to know they existed.
use Vec as BumpVec;
pub
pub type EventStream<'a> = ;
/// Abstracts where a parser state machine emits events.
///
/// Two real implementations: `BumpVec<Event<'a>>` for the callback-
/// style public API (full document tokenized into one slab, then
/// iterated), and `Vec<Event<'a>>` for the streaming deserializer
/// (small reusable per-line queue, no whole-document buffer).
///
/// Generifying the parser over this trait keeps a single state-machine
/// implementation serving both modes. Monomorphisation specialises
/// each call site, so dispatch is free.
pub