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>,
pub missing_data: Vec<String>,
}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>§missing_data: Vec<String>Unbound caller data paths still live for this rule under the current run data
(DataPath::input_key strings, same keys as Show.data).
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 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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RuleResult
impl Debug for RuleResult
Auto Trait Implementations§
impl Freeze for RuleResult
impl RefUnwindSafe for RuleResult
impl Send for RuleResult
impl Sync for RuleResult
impl Unpin for RuleResult
impl UnsafeUnpin for RuleResult
impl UnwindSafe for RuleResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more