datalogic-rs
A Rust implementation of JSONLogic that provides a way to write portable logic rules as JSON.
Overview
datalogic-rs implements the complete JSONLogic specification, allowing you to create, share, and evaluate rules across different platforms while staying true to Rust's safety and performance principles.
Installation
Add to your Cargo.toml:
[]
= "0.1.0"
Quick Example
use JsonLogic;
use json;
Supported Operations
This implementation supports all standard JSONLogic operations including:
- Basic operators (
==,===,!=,!==,>,>=,<,<=) - Logic operators (
!,!!,or,and,if) - Numeric operations (
+,-,*,/,%) - Array operations (
merge) - String operations (
cat,substr) - Data access (
var)
For detailed documentation of operations and examples, visit jsonlogic.com.
Features
- โ Complete implementation of JSONLogic specification
- ๐ Zero-copy JSON deserialization
- ๐ก๏ธ Type-safe rule evaluation
- ๐งช Comprehensive test suite matching official JSONLogic tests
Testing
The library includes a comprehensive test suite that verifies compatibility with the official JSONLogic test cases:
License
Licensed under Apache-2.0
References
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.