Skip to main content

Crate jpx_core

Crate jpx_core 

Source
Expand description

jpx-core: A complete JMESPath implementation using serde_json::Value.

This crate provides a JMESPath parser, interpreter, and runtime that works directly with serde_json::Value, eliminating the need for a separate Variable type and the conversion overhead that comes with it.

§Quick Start

use jpx_core::compile;
use serde_json::json;

let expr = compile("foo.bar").unwrap();
let data = json!({"foo": {"bar": true}});
let result = expr.search(&data).unwrap();
assert_eq!(result, json!(true));

Re-exports§

pub use crate::interpreter::SearchResult;
pub use crate::registry::Category;
pub use crate::registry::Feature;
pub use crate::registry::FunctionInfo;
pub use crate::registry::FunctionRegistry;
pub use crate::value_ext::JmespathType;
pub use crate::value_ext::ValueExt;

Modules§

ast
JMESPath Abstract Syntax Tree.
extensions
Extension functions for JMESPath.
functions
JMESPath functions.
interpreter
Interprets JMESPath expressions.
query_library
Named Query Library parser for .jpx files.
registry
Function registry for runtime control and introspection.
value_ext
Extension trait for serde_json::Value providing JMESPath operations.

Macros§

arg
defn

Structs§

Context
Context object used during expression evaluation.
Expression
A compiled JMESPath expression.
JmespathError
A JMESPath error with position information.
Runtime
Compiles JMESPath expressions and manages registered functions.
RuntimeBuilder
Builder for creating a Runtime with selective function registration.

Enums§

ErrorReason
The reason for a JMESPath error.
RuntimeError
Runtime errors that can occur during expression evaluation.

Statics§

DEFAULT_RUNTIME
The default runtime with all 26 built-in JMESPath functions registered.

Functions§

compile
Compiles a JMESPath expression using the default Runtime.
get_expref_id
Extracts the expref ID from a sentinel value.
parse
Parses a JMESPath expression into an AST.

Type Aliases§

ParseResult
Result of parsing an expression.