pub enum Pattern {
Var(String),
Constant(f64),
Pred {
name: String,
args: Vec<Pattern>,
},
And(Box<Pattern>, Box<Pattern>),
Or(Box<Pattern>, Box<Pattern>),
Not(Box<Pattern>),
Imply(Box<Pattern>, Box<Pattern>),
Any,
}Expand description
A pattern that can match against expressions.
Variants§
Var(String)
Match any expression and bind it to a variable
Constant(f64)
Match a specific constant value
Pred
Match a predicate with a specific name
And(Box<Pattern>, Box<Pattern>)
Match an AND expression
Or(Box<Pattern>, Box<Pattern>)
Match an OR expression
Not(Box<Pattern>)
Match a NOT expression
Imply(Box<Pattern>, Box<Pattern>)
Match an implication
Any
Match any expression (wildcard)
Implementations§
Trait Implementations§
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