Skip to main content

Crate dataflow_rs

Crate dataflow_rs 

Source
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.

§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 the expr::OperatorFamily::Datetime operators (still selected at runtime on expr::ExprEngineBuilder) and changes == and the ordering operators on plain date-shaped strings across the build.
  • tensor: the Tensor value and expr::OperatorFamily::Tensor operators (selected at runtime on expr::ExprEngineBuilder). Not in expr::ExprEngineBuilder::all_operators, since names like shape, full, cast and concat are ordinary JSON keys.
  • budget: a ceiling on the operations of one evaluation, which ExprEngineBuilder::ops_budget sets.
  • wasm-web: the browser’s clock and randomness, which wasm32-unknown-unknown needs and native targets must not pull in.
  • ts: derives ts_rs::TS on the wire shapes, from which tests/ts_types.rs renders bindings/dataflow.d.ts, which ships in the package. ts is 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 its Run, with its Trace when one was asked for.
program
Programs: a definition compiled for execution.
run
Runs: executing a program over a message.

Structs§

Error
Why a run, a compile or a function failed.
Issue
One finding about an authored definition.

Enums§

ErrorKind
The class of an Error. It decides the recorded code.

Constants§

VERSION
The crate version.

Type Aliases§

Result
The result of a fallible v4 operation.