pub enum Pattern {
Var(String, Span),
Lit(String, Span),
Plain {
op: String,
children: Vec<Pattern>,
span: Span,
},
AExact {
op: String,
children: Vec<Pattern>,
span: Span,
},
APrefix {
op: String,
rest: String,
fixed: Vec<Pattern>,
span: Span,
},
ASuffix {
op: String,
fixed: Vec<Pattern>,
rest: String,
span: Span,
},
ABoth {
op: String,
pre: String,
fixed: Vec<Pattern>,
suf: String,
span: Span,
},
ACExact {
op: String,
elems: Vec<(Pattern, MultSpec)>,
span: Span,
},
ACSub {
op: String,
elems: Vec<(Pattern, MultSpec)>,
rest: String,
span: Span,
},
ACIExact {
op: String,
elems: Vec<Pattern>,
span: Span,
},
ACISub {
op: String,
elems: Vec<Pattern>,
rest: String,
span: Span,
},
}Variants§
Var(String, Span)
Bare identifier = pattern variable.
Lit(String, Span)
Literal constant (integer, rational, bool).
Plain
(op p1 p2 ...) — plain/C application (including nullary (op)).
AExact
(op [p1 p2 ...]) — A exact.
APrefix
(op [..pre p1 ...]) — A with prefix rest.
ASuffix
(op [p1 ... ..suf]) — A with suffix rest.
ABoth
(op [..pre p1 ... ..suf]) — A with both rests.
ACExact
(op {e1:m1 e2:m2 ...}) — AC exact.
ACSub
(op {e1:m1 ... ..rest}) — AC subset.
ACIExact
(op {e1 e2 ...}) — ACI exact.
ACISub
(op {e1 ... ..rest}) — ACI subset.
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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.