Expand description
Reusable field validation for sector plugins.
Validator is a fluent collector: each require_* / optional_* method
records a PluginFieldError when a check fails and is chainable, so a
plugin’s validate_input reads as a declarative list of field constraints.
Validator::finish reports all failures at once rather than stopping at
the first — better for surfacing form errors to a manufacturer.
The free functions num and str_of are convenience readers for
calculate_metrics bodies, and threshold_status is the shared
“measured value at or under threshold” classification they compare against.
Structs§
- Validator
- Fluent per-field validator. See module docs.
Functions§
- num
- Read a finite number field (ignores absent/non-numeric/NaN/inf).
- str_of
- Read a string field.
- threshold_
status - Classify a measured value against a compliance threshold:
Compliantif present and at or underthreshold,NonCompliantotherwise (including whenvalueis absent — a missing measurement is not assumed compliant).