evaluate_multifield_pattern

Function evaluate_multifield_pattern 

Source
pub fn evaluate_multifield_pattern(
    facts: &TypedFacts,
    field: &str,
    operator: &MultifieldOp,
    variable: Option<&str>,
    value: Option<&FactValue>,
    bindings: &HashMap<String, FactValue>,
) -> Option<HashMap<String, FactValue>>
Expand description

Helper function to evaluate multi-field patterns in rules

This function combines the multi-field operation with variable binding. It returns both the result values and optional variable bindings.

§Arguments

  • facts - The facts to evaluate against
  • field - The field name (e.g., “items”)
  • operator - The multi-field operation
  • variable - Optional variable name for binding (e.g., “$?all_items”)
  • value - Optional value for operations like Contains
  • bindings - Existing variable bindings

§Returns

Some(HashMap<Variable, FactValue>) - New bindings including multi-field results None - Pattern doesn’t match