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),
in evaluation / decision-tree order (contrast Show.data declaration order).
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
Source§impl From<&RuleResult> for RuleResult
impl From<&RuleResult> for RuleResult
Source§fn from(result: &DomainRuleResult) -> Self
fn from(result: &DomainRuleResult) -> Self
Converts to this type from the input type.
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