pub struct RuleResult {
pub rule: EvaluatedRule,
pub veto_detail: Option<VetoType>,
pub vetoed: bool,
pub veto_reason: Option<String>,
pub rule_type: String,
pub value: Option<RuleResultValue>,
pub explanation: Option<Explanation>,
/* private fields */
}Expand description
Result of evaluating a single rule. Struct fields match the API JSON shape.
Fields§
§rule: EvaluatedRule§veto_detail: Option<VetoType>§vetoed: bool§veto_reason: Option<String>§rule_type: String§value: Option<RuleResultValue>Flattened value fields, including display when the rule is not vetoed.
explanation: Option<Explanation>Implementations§
Source§impl RuleResult
impl RuleResult
Sourcepub fn display(&self) -> Option<&str>
pub fn display(&self) -> Option<&str>
Engine-rendered display string from the flattened RuleResultValue.
Sourcepub fn awaits_missing_data(&self) -> bool
pub fn awaits_missing_data(&self) -> bool
True when this rule still waits on unbound inputs (MissingData veto).
Value and non-MissingData vetoes are settled answers; leftover live keys in
Self::missing_data must not drive prompts or human “Missing data” display.
Sourcepub fn missing_data(&self) -> &[String]
pub fn missing_data(&self) -> &[String]
Unbound caller data paths still live for this rule (DataPath::input_key).
Sourcepub fn from_operation_result(
rule: EvaluatedRule,
operation_result: &OperationResult,
rule_type: &LemmaType,
explanation: Option<Explanation>,
missing_data: Vec<String>,
) -> Self
pub fn from_operation_result( rule: EvaluatedRule, operation_result: &OperationResult, rule_type: &LemmaType, explanation: Option<Explanation>, missing_data: Vec<String>, ) -> Self
Build a RuleResult for API output from a rule evaluation result.
Measure and ratio payloads expand into every unit declared on rule_type.
Sourcepub fn to_literal(&self) -> LiteralValue
pub fn to_literal(&self) -> LiteralValue
Reconstruct the evaluated LiteralValue from committed RuleResultValue fields.
Panics if the rule is vetoed or fields cannot be reconstructed.
Trait Implementations§
Source§impl Clone for RuleResult
impl Clone for RuleResult
Source§fn clone(&self) -> RuleResult
fn clone(&self) -> RuleResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more