Skip to main content

Crate weirdnet_rules

Crate weirdnet_rules 

Source
Expand description

If-this-then-that over an event history: rule specs generic over the application’s then-actions, the condition syntax and comparison, templates, every/cron schedules, and a matching, loop-protected engine that reaches the application only through engine::Host.

Modules§

compare
How a condition compares a JSON value: numbers as numbers, text case-insensitively with * globs for =, arrays by any element (and by length for </>), missing values only satisfying !?, != and !~.
engine
Matching and running rules against events, with loop protection.
schedule
Schedules: every 6h and five-field cron, their text forms, and when a rule runs next.
syntax
The text forms: on patterns, conditions, lists, words and quoting.
template
Templates: {rule}, {date}, {time}, {now} and {FIELD} from a lookup.

Structs§

Condition
field op value, e.g. inserted > 0, format = pdf, summary ~ btc.
RuleSpec
When a rule runs and what it does; T is the application’s then-action.

Enums§

Op
How a condition compares.
RulesError
A rule, condition, pattern or schedule that does not parse.
Schedule
When a scheduled rule runs: every so often (every 6h) or at cron times (cron "0 3 * * *"). See crate::schedule::next_run.

Constants§

SPEC_VERSION
Spec version written by this crate.

Traits§

ThenAction
A then-action of the application’s own type: the engine only needs its verb (for run results and failure messages).

Type Aliases§

Result