pub enum Pattern {
BindPattern(TypeId, VarId, Box<Pattern>),
Var(TypeId, VarId),
ConstInt(TypeId, i128),
ConstPrim(TypeId, Sym),
Term(TypeId, TermId, Vec<Pattern>),
Wildcard(TypeId),
And(TypeId, Vec<Pattern>),
}
Expand description
A left-hand side pattern of some rule.
Variants§
BindPattern(TypeId, VarId, Box<Pattern>)
Bind a variable of the given type from the current value.
Keep matching on the value with the subpattern.
Var(TypeId, VarId)
Match the current value against an already bound variable with the given type.
ConstInt(TypeId, i128)
Match the current value against a constant integer of the given integer type.
ConstPrim(TypeId, Sym)
Match the current value against a constant primitive value of the given primitive type.
Term(TypeId, TermId, Vec<Pattern>)
Match the current value against the given extractor term with the given arguments.
Wildcard(TypeId)
Match anything of the given type successfully.
And(TypeId, Vec<Pattern>)
Match all of the following patterns of the given type.
Implementations§
Trait Implementations§
impl Eq for Pattern
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