Expand description
Jetro core — parser, compiler, and VM for the Jetro JSON query language.
§Execution path
source text
│ parse::parser::parse() → Expr AST
│ plan::physical::plan_query() → QueryPlan (physical IR)
│ exec::router::collect_*() → dispatches to:
│ StructuralIndex backend (jetro-experimental bitmap)
│ ViewPipeline backend (borrowed tape/Val navigation)
│ Pipeline backend (pull-based composed stages)
└─ VM fallback (bytecode stack machine)§Quick start
use jetro_core::Jetro;
let j = Jetro::from_bytes(br#"{"books":[{"price":12}]}"#.to_vec()).unwrap();
assert_eq!(j.collect("$.books.len()").unwrap(), serde_json::json!(1));Macros§
- for_
each_ builtin - Expands
$macro!(...)once perBuiltinMethodvariant — the single source of truth for “all builtin methods” used by name lookup, registry exports, and any future cross-cutting per-method generation. Variant names match the correspondingdefs::*struct names.
Structs§
- Eval
Error - Evaluation error carrying a human-readable message. Propagated through
Result<Val, EvalError>across all execution layers. - Jetro
- Primary entry point. Holds a JSON document and evaluates expressions against
it. Lazy fields (
root_val,tape,structural_index,objvec_cache) are populated on first use so callers only pay for the representations a particular query actually needs. - Jetro
Engine - Long-lived multi-document query engine with an explicit plan cache. Use when the same process evaluates many expressions over many documents — parse/lower/compile work is amortised by this object, not hidden in thread-local state.
Enums§
- Jetro
Engine Error - Error returned by
JetroEngine::collect_bytesand similar methods that may fail during JSON parsing or during expression evaluation.