Expand description
A high-performance rules engine for IFTTT-style automation and data processing pipelines in Rust.
Workflows are JSON definitions whose tasks run built-in or host functions
over a Message’s context, with JSONLogic conditions and expressions
compiled once at build time.
def: parse and lint authored workflow JSON into aWorkflowDef.program: compile definitions against aRegistryinto an immutableprogram::Program.run: execute a program over aMessagewithEngine::runorEngine::run_with, returning aRunon every outcome.function: implementFunctionwith a#[derive(FunctionConfig)]config for typed async host actions, or wrap calls in afunction::CallLayer.expr: compiledExpr<T>,Path,expr::Output,expr::Interpolateddocuments, andexpr::Secrets.observe: inlineObserverevents and replayableobserve::Traces.compat: migrate 3.x definitions to the 4.0 spelling withcompat::migrate_v3.
§Features
None is on by default. The six standard extension operator families
(ExtString, ExtArray, ExtMath, ExtControl, ExtObject and
ErrorHandling) are compiled in unconditionally and selected at runtime on
expr::ExprEngineBuilder, which defaults to expr::OperatorFamily::Core
(and secret) only.
datetime: compiles in theexpr::OperatorFamily::Datetimeoperators (still selected at runtime onexpr::ExprEngineBuilder) and changes==and the ordering operators on plain date-shaped strings across the build.tensor: theTensorvalue andexpr::OperatorFamily::Tensoroperators (selected at runtime onexpr::ExprEngineBuilder). Not inexpr::ExprEngineBuilder::all_operators, since names likeshape,full,castandconcatare ordinary JSON keys.budget: a ceiling on the operations of one evaluation, whichExprEngineBuilder::ops_budgetsets.wasm-web: the browser’s clock and randomness, whichwasm32-unknown-unknownneeds and native targets must not pull in.ts: derivests_rs::TSon the wire shapes, from whichtests/ts_types.rsrendersbindings/dataflow.d.ts, which ships in the package.tsis outside semver: the wire shapes are covered by semver, but the generator, its output’s layout and this feature’s dependencies may change in any release.
§Dependencies in the API
datalogic_rs and datavalue are re-exported, and part of this
crate’s API: a value is a datavalue::OwnedDataValue (a context, a
secret, a resolved config), and a host’s custom operator is a
datalogic_rs::CustomOperator. A host names both through these
re-exports, so its versions are always the engine’s. A major version of
either is a major version of this crate.
Re-exports§
pub use crate::def::WorkflowDef;pub use crate::expr::Expr;pub use crate::expr::Path;pub use crate::function::Ctx;pub use crate::function::Function;pub use crate::function::Outcome;pub use crate::function::Registry;pub use crate::observe::Observer;pub use crate::run::Engine;pub use crate::run::Message;pub use crate::run::Run;pub use crate::run::RunOptions;pub use datalogic_rs;pub use datavalue;
Modules§
- compat
- Compatibility with v3 definitions and behaviour.
- def
- Definitions: the authored form of workflows and tasks.
- expr
- Expressions: the JSONLogic surface a definition is written in.
- function
- Functions: the typed units of work a task runs.
- observe
- What a run reports about itself: as it goes, to an
Observer, and once it ends, on itsRun, with itsTracewhen one was asked for. - program
- Programs: a definition compiled for execution.
- run
- Runs: executing a program over a message.
Structs§
Enums§
Constants§
- VERSION
- The crate version.
Type Aliases§
- Result
- The result of a fallible v4 operation.