Skip to main content

Module rules

Module rules 

Source
Expand description

The C ABI for rules between nodes.

A rule file is judged here reading by reading, with no link: the host hands over the topic and the reading each message carried, and learns which rules set or cleared and what each calls for, which the host then carries out. That is the deciding half of the Rust RuleEngine, which owns a link and actuators and so cannot cross a C ABI.

What fired crosses as JSON, an array of objects with the rule by name, the edge (set or cleared), the reading, and its actions, each written exactly as the rule file writes an action: { "drive": ..., "on": ... } or { "publish": ..., "payload": ... }.

Structs§

PamojaRuleEvaluator
An opaque handle to a set of rules armed to judge readings.

Functions§

pamoja_rule_evaluator_actuators_json⚠
Lists the actuators the rules drive, which are the outputs the host has to have.
pamoja_rule_evaluator_evaluate⚠
Judges one reading from one topic against every rule that watches it.
pamoja_rule_evaluator_free⚠
Releases an evaluator handle.
pamoja_rule_evaluator_from_json⚠
Loads a rule file and arms its rules, every condition starting cleared.
pamoja_rule_evaluator_is_set⚠
Reports whether a rule’s condition currently holds.
pamoja_rule_evaluator_to_json⚠
Writes the rules back out as the file a fleet shares.
pamoja_rule_evaluator_topics_json⚠
Lists the topics the rules watch, which are the topics to subscribe to.
pamoja_rule_evaluator_watches⚠
Reports whether any rule watches a topic, so the host knows whether to decode a message before handing it over.