Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

rust-runes is a rule engine for embedding business logic in Rust applications. It is compatible with Grule’s rule language (GRL) and execution model: Grule’s .grl files load unchanged and fire the same rules.

Rules state what to do when a condition holds:

rule LongRide "Long rides get a flat rate" salience 10 {
    when
        Ride.Distance > 5000 && !Ride.Priced
    then
        Ride.NetAmount = 143.32;
        Ride.Priced = true;
}

Your application keeps the rules outside its code, hands the engine some facts (usually its own serde types), and the engine runs the rules until none applies.

This guide covers:

The API documentation describes every type and method.

rust-runes is an independent implementation; it is not affiliated with the Grule project.