Skip to main content

jetro_experimental/
lib.rs

1//! jetro-experimental — structural stage-1 over JSON bytes.
2//!
3//! Single pass → columnar output:
4//!   - byte_offset[i] : u32     // position of every structural char
5//!   - kind[i]        : Kind    // {, }, [, ], " (opening), :, ,
6//!   - depth[i]       : u16     // nesting depth at that offset
7//!
8//! Strings tracked end-to-end; bytes between unescaped quotes never appear
9//! in the output. AVX2 fast path ~25 GB/s, scalar fallback ~5-10 GB/s.
10
11#![allow(unsafe_op_in_unsafe_fn)]
12
13// === Public API (stable) ===
14pub mod api;
15pub mod op;
16
17pub use op::{run_count, run_first, Ctx, Op, OpPlan};
18
19pub use api::{
20    count_key, find_eq, find_eq_compound, from_bytes, from_bytes_with, json_number_eq,
21    json_string_eq, parse_f64, parse_i64, BuildOptions, ByteSpan, Error, KeyHits, StructuralIndex,
22    TokenId, TokenKind, Tokens,
23};
24
25#[cfg(feature = "multi-key")]
26pub use api::{multi_key_finder, multi_key_scan};
27
28#[cfg(feature = "validate-utf8")]
29pub use api::validate_utf8;
30
31// === Internals (kept public for tests/benches; do not depend on these
32// from library code — they may change without semver bumps).
33#[doc(hidden)]
34pub mod index;
35#[doc(hidden)]
36pub mod keys;
37#[doc(hidden)]
38pub mod stage1;
39
40#[doc(hidden)]
41pub use index::{parent_chain, token_at, StructIndex};
42#[doc(hidden)]
43pub use keys::{KeyBitmaps, Role};
44#[doc(hidden)]
45pub use stage1::{run, run_scalar, Kind, Stage1};