Skip to main content

Module rules

Module rules 

Source
Expand description

CRUDUI validation rule registry (VALIDATION-RULES, JS rules/* parity).

Each rule is a function over a RuleContext returning the error message (Some) or None (pass). The rules mirror the JS reference engine (packages/validator/ts/src/rules/*) function-for-function so the shared 4-language fixture (tests/fixtures/validate/cases.json) holds bit-for-bit: same skip-on-empty behaviour, same default messages with {0}/{1} substitution, same loose comparisons.

The call site is the CRUDUI validate slot; the rule semantics are the JS rule registry re-expressed in Rust.

Structs§

RuleContext
The per-rule invocation context handed to a rule function.

Functions§

get_rule
Look up a registered rule by name. Returns None for any other name, which fails the load with UNKNOWN_RULE.
get_value_by_path
Read a value at concrete path segments (JS getValueByPath). Missing → null.
is_condition_expression
JS isConditionExpression: a string that looks like a condition.
resolve_field_reference
Resolve a field-reference expression to its value (JS resolveFieldReference): .x / ..x relatives with a row as one level, a dotted path from the root and a bare name resolved as .name.