pub enum Lean4Pattern {
Wildcard,
Var(String),
Ctor(String, Vec<Lean4Pattern>),
Tuple(Vec<Lean4Pattern>),
Lit(String),
Or(Box<Lean4Pattern>, Box<Lean4Pattern>),
Anonymous(Vec<Lean4Pattern>),
}Expand description
Pattern in a match expression.
Variants§
Wildcard
Wildcard: _
Var(String)
Variable binding: x
Ctor(String, Vec<Lean4Pattern>)
Constructor pattern: .some x, List.cons h t
Tuple(Vec<Lean4Pattern>)
Tuple pattern: (a, b)
Lit(String)
Literal pattern: 0, true, "hello"
Or(Box<Lean4Pattern>, Box<Lean4Pattern>)
Or pattern: p | q
Anonymous(Vec<Lean4Pattern>)
Anonymous constructor: ⟨a, b⟩
Trait Implementations§
Source§impl Clone for Lean4Pattern
impl Clone for Lean4Pattern
Source§fn clone(&self) -> Lean4Pattern
fn clone(&self) -> Lean4Pattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Lean4Pattern
impl Debug for Lean4Pattern
Source§impl Display for Lean4Pattern
impl Display for Lean4Pattern
Source§impl Hash for Lean4Pattern
impl Hash for Lean4Pattern
Source§impl PartialEq for Lean4Pattern
impl PartialEq for Lean4Pattern
impl Eq for Lean4Pattern
impl StructuralPartialEq for Lean4Pattern
Auto Trait Implementations§
impl Freeze for Lean4Pattern
impl RefUnwindSafe for Lean4Pattern
impl Send for Lean4Pattern
impl Sync for Lean4Pattern
impl Unpin for Lean4Pattern
impl UnsafeUnpin for Lean4Pattern
impl UnwindSafe for Lean4Pattern
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