Skip to main content

Module statement

Module statement 

Source
Expand description

Statement input for the workshop-rs/rule-content-v1 format.

statement_from_content is the read direction of the format’s input side: it converts one condition or action list item — {"value": node} or {"call": id, "args": [...]}, with optional "disabled": true — into the public model. A statement read from crate::Rule::content is valid input unchanged, so rendering the converted statement again gives the same document. The format id and schema are unchanged.

The conversion refuses, with a distinct StatementContentError, every node it cannot turn into exactly the construct the node names: an unknown id, a wrong argument count, an internal sentinel, a node that forms no statement, and a node carrying spans. Nothing is approximated. A preserved ambiguous enum member is refused too: it carries a locale-dependent spelling, and the model value would not be the one a client wrote.

Enums§

Statement
One rule statement in the public model: a condition or an action.
StatementContentError
Why statement_from_content refused a node. Every variant names the offending node by its JSON pointer from the statement ("" is the statement itself) and a copy of the node.

Functions§

statement_from_content
Convert one rule-content-v1 statement into the public model.