rule_kit
A blazing-fast, composable, and DSL-friendly rule engine kit for Rust.
Define your rules. Plug your context (mutable or immutable). Let the engine do the rest.
✨ Features
- Minimal core: no assumptions, no boilerplate
- Pluggable rules: implement
Rule<T>for any context (mutable support) - DSL-friendly: support JSON/YAML/Struct-based rules
- Built for scale: evaluate hundreds of rules with ease
- Supports mutable context during rule application for stateful workflows
🚀 Quick Start
Define a context (e.g., a struct), implement Rule<T> with mutable apply, and plug it into RuleEngine:
use ;
use RuleEngineBuilder;
use PriorityOrder;
📦 Design Philosophy
rule_kit is designed to be:
- Composable — add your own rule logic without modifying the engine
- Extensible — supports rule metadata, DSL parsing, logging, etc.
- Performant — built with scaling in mind (Rayon-friendly)
- Flexible — supports mutable context in rules for stateful business logic
You implement the Rule<T> trait for your domain, where apply can mutate both the rule instance and the context, enabling advanced scenarios like workflow progression, state updates, or side effects.
📜 License
Licensed under:
- Apache License, Version 2.0 LICENSE
🧑💻 Author
Created and maintained by Jerry Maheswara
Feel free to reach out for suggestions, issues, or improvements!
❤️ Built with Love in Rust
This project is built with ❤️ using Rust — a systems programming language that is safe, fast, and concurrent. Rust is the perfect choice for building reliable and efficient applications.
👋 Contributing
Pull requests, issues, and feedback are welcome!
If you find this crate useful, give it a ⭐ and share it with others in the Rust community.