Rust Rules Engine

Pure Rust rules engine with zero-cost abstractions. Async-ready business rule evaluation with maximum performance and memory safety.

Step 1

Add the Dependency

Add the GoRules engine to your Cargo.toml.

cargo add zen-engine
Step 2

Load a Decision

Create an engine and load your decision graph.

use zen_engine::DecisionEngine;
use zen_engine::model::DecisionContent;

let content: DecisionContent = serde_json::from_str(
    include_str!("./decision.json")
)?;

let engine = DecisionEngine::default();
let decision = engine.create_decision(content.into());
Step 3

Evaluate Rules

Pass your input data and receive the decision result.

use serde_json::json;

let result = decision.evaluate(&json!({
    "customer": { "tier": "premium", "country": "US" },
    "cart": { "total": 150, "items": 3 }
})).await?;

println!("{:?}", result.result); // {"discount": 15, "freeShipping": true}

Why Rust?

Built for performance and developer experience

Zero-Cost Abstractions

Pure Rust implementation with no runtime overhead. Compile-time optimizations for maximum speed.

Async Runtime

Built on Tokio for efficient async execution. Perfect for high-throughput applications.

Memory Safe

Rust's ownership model guarantees memory safety without garbage collection pauses.

About the Rust SDK

The GoRules Rust SDK is the foundation of our entire ecosystem. Written in pure Rust, it provides the highest possible performance for business rule evaluation with zero-cost abstractions and compile-time optimizations.

The engine leverages Rust's ownership model for guaranteed memory safety without garbage collection pauses. Built on Tokio, it supports efficient async execution for I/O-bound operations while maintaining blazing-fast synchronous evaluation for pure rule processing.

This is the same engine that powers all our other language SDKs through native bindings. For applications where every microsecond counts, or when you want maximum control over the rule evaluation process, the Rust SDK delivers uncompromising performance.

Ready to get started?

Start building business rules in minutes with our free tier.