ooroo 0.3.0

A fast, compiled rule engine with a text-based DSL
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use ooroo::{Context, RuleSet};

fn main() {
    let ruleset = RuleSet::from_file("examples/rules.ooroo").expect("failed to load rules");

    println!("{ruleset}");

    let ctx = Context::new()
        .set("user.age", 25_i64)
        .set("user.status", "active")
        .set("user.banned", false);

    match ruleset.evaluate(&ctx) {
        Some(verdict) => println!("Verdict: {verdict}"),
        None => println!("No terminal matched."),
    }
}