pub struct ACPattern {
pub operator: ACOperator,
pub fixed_operands: Vec<TLExpr>,
pub variable_operands: Vec<String>,
}Expand description
AC pattern matching with variable bindings.
This is more sophisticated than simple AC-equivalence checking, as it allows pattern variables to match subsets of operands.
Fields§
§operator: ACOperatorThe AC operator for this pattern
fixed_operands: Vec<TLExpr>Fixed operands that must match exactly
variable_operands: Vec<String>Variable operands that can match multiple elements
Implementations§
Source§impl ACPattern
impl ACPattern
Sourcepub fn new(operator: ACOperator) -> Self
pub fn new(operator: ACOperator) -> Self
Create a new AC pattern.
Sourcepub fn with_fixed(self, operand: TLExpr) -> Self
pub fn with_fixed(self, operand: TLExpr) -> Self
Add a fixed operand to the pattern.
Sourcepub fn with_variable(self, var: impl Into<String>) -> Self
pub fn with_variable(self, var: impl Into<String>) -> Self
Add a variable operand to the pattern.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ACPattern
impl RefUnwindSafe for ACPattern
impl Send for ACPattern
impl Sync for ACPattern
impl Unpin for ACPattern
impl UnwindSafe for ACPattern
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