pub enum Expression {
Field(String),
Literal(Value),
Comparison {
left: Box<Expression>,
operator: Operator,
right: Box<Expression>,
},
And {
left: Box<Expression>,
right: Box<Expression>,
},
Or {
left: Box<Expression>,
right: Box<Expression>,
},
Not(Box<Expression>),
Variable(String),
}Expand description
Expression AST node
Variants§
Field(String)
Field reference (e.g., “User.IsVIP”, “Order.Amount”)
Literal(Value)
Literal value (e.g., true, false, 42, “hello”)
Comparison
Binary comparison (e.g., “X == Y”, “A > B”)
And
Logical AND operation (e.g., “A && B”)
Or
Logical OR operation (e.g., “A || B”)
Not(Box<Expression>)
Negation (e.g., “!X”)
Variable(String)
Variable (for future unification support, e.g., “?X”, “?Customer”)
Implementations§
Source§impl Expression
impl Expression
Sourcepub fn is_satisfied(&self, facts: &Facts) -> bool
pub fn is_satisfied(&self, facts: &Facts) -> bool
Check if expression is satisfied (returns true/false)
Sourcepub fn extract_fields(&self) -> Vec<String>
pub fn extract_fields(&self) -> Vec<String>
Extract all field references from expression
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a duplicate of the value. Read more
1.0.0 · 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 Expression
impl Debug for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
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