pub enum ExprNode<'a, T> {
Variable(&'a str),
And(T, T),
Or(T, T),
Not(T),
Constant(bool),
}Expand description
Node type for expression tree folding
This enum represents the structure of an expression node without exposing
internal Arc types. It’s used with BoolExpr::fold and BoolExpr::fold_with_context
to traverse and transform expression trees.
§Generic Parameter
- For
BoolExpr::fold:Trepresents the accumulated result from child nodes (bottom-up) - For
BoolExpr::fold_with_context:Tis()since context flows top-down via closures
§Examples
See BoolExpr::fold and BoolExpr::fold_with_context for detailed usage examples.
Variants§
Variable(&'a str)
A variable with the given name
And(T, T)
Logical AND with results from left and right subtrees
Or(T, T)
Logical OR with results from left and right subtrees
Not(T)
Logical NOT with result from inner subtree
Constant(bool)
A constant boolean value
Trait Implementations§
impl<'a, T: Eq> Eq for ExprNode<'a, T>
impl<'a, T> StructuralPartialEq for ExprNode<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for ExprNode<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for ExprNode<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ExprNode<'a, T>where
T: Send,
impl<'a, T> Sync for ExprNode<'a, T>where
T: Sync,
impl<'a, T> Unpin for ExprNode<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for ExprNode<'a, T>where
T: UnwindSafe,
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