pub enum Pattern {
Any,
Op(String),
BinaryOp {
op: String,
left: Box<Pattern>,
right: Box<Pattern>,
},
UnaryOp {
op: String,
operand: Box<Pattern>,
},
Constant(f64),
Zero,
One,
Variable(String),
Sequence(Vec<Pattern>),
Alternative(Vec<Pattern>),
}Expand description
Graph pattern for matching.
Variants§
Any
Match any node
Op(String)
Match a specific operation
BinaryOp
Match a binary operation with two subpatterns
UnaryOp
Match a unary operation with one subpattern
Constant(f64)
Match a constant value
Zero
Match zero
One
Match one
Variable(String)
Match a variable (captures the matched node)
Sequence(Vec<Pattern>)
Match a sequence of operations
Alternative(Vec<Pattern>)
Match any of the given patterns
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Pattern
impl<'de> Deserialize<'de> for Pattern
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Pattern
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnwindSafe for Pattern
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