pub enum Predicate {
Comparison(Comparison),
And(Vec<Predicate>),
Or(Vec<Predicate>),
}Expand description
Abstract Syntax Tree (AST) node for condition evaluation.
Predicates can be nested to form complex logical expressions.
§Variants
Comparison: Leaf node (single field comparison)And: All child predicates must be trueOr: At least one child predicate must be true
§Examples
Simple comparison:
{"user.tier": {"$eq": "Gold"}}Complex AND:
{"user.tier": {"$eq": "Gold"}, "amount": {"$gt": 100}}Explicit OR:
{"$or": [{"tier": {"$eq": "Gold"}}, {"tier": {"$eq": "Platinum"}}]}Variants§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Predicate
impl RefUnwindSafe for Predicate
impl Send for Predicate
impl Sync for Predicate
impl Unpin for Predicate
impl UnwindSafe for Predicate
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