json_eval_rs/lib.rs
1//! JSON Eval RS - High-performance JSON Logic evaluation library
2//!
3//! This library provides a complete implementation of JSON Logic with advanced features:
4//! - Pre-compilation of logic expressions for optimal performance
5//! - Mutation tracking via proxy-like data wrapper (EvalData)
6//! - All data mutations gated through EvalData for thread safety
7//! - Zero external logic dependencies (built from scratch)
8
9// Use mimalloc allocator on Windows for better performance
10#[cfg(windows)]
11#[global_allocator]
12static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
13
14pub mod parse_schema;
15pub mod rlogic;
16// Modules moved to jsoneval
17pub mod topo_sort;
18// pub mod eval_cache;
19// pub mod eval_data;
20// pub mod json_parser;
21// pub mod parsed_schema;
22// pub mod parsed_schema_cache;
23// pub mod path_utils;
24// pub mod subform_methods;
25// pub mod table_evaluate;
26// pub mod table_metadata;
27// pub mod types;
28
29// New modular structure
30pub mod jsoneval;
31// pub mod types;
32#[macro_use]
33pub mod utils;
34
35// FFI module for C# and other languages
36#[cfg(feature = "ffi")]
37pub mod ffi;
38
39// WebAssembly module for JavaScript/TypeScript
40#[cfg(feature = "wasm")]
41pub mod wasm;
42
43// Re-export main types for convenience
44pub use jsoneval::eval_cache::{CacheKey, CacheStats, EvalCache};
45pub use jsoneval::eval_data::EvalData;
46pub use jsoneval::parsed_schema::ParsedSchema;
47pub use jsoneval::parsed_schema_cache::{ParsedSchemaCache, ParsedSchemaCacheStats, PARSED_SCHEMA_CACHE};
48pub use jsoneval::path_utils::ArrayMetadata;
49pub use rlogic::{
50 CompiledLogic, CompiledLogicId, CompiledLogicStore, CompiledLogicStoreStats, Evaluator,
51 LogicId, RLogic, RLogicConfig,
52};
53pub use jsoneval::table_metadata::TableMetadata;
54
55// Re-export from new modules
56// Re-export from new modules
57pub use jsoneval::JSONEval;
58pub use jsoneval::types::*;
59pub use utils::*;
60
61/// Get the library version
62pub fn version() -> &'static str {
63 env!("CARGO_PKG_VERSION")
64}