Enum gluon_base::ast::Pattern [−][src]
pub enum Pattern<Id> { As(Id, Box<SpannedPattern<Id>>), Constructor(TypedIdent<Id>, Vec<SpannedPattern<Id>>), Ident(TypedIdent<Id>), Record { typ: ArcType<Id>, types: Vec<PatternField<Id, Id>>, fields: Vec<PatternField<Id, SpannedPattern<Id>>>, implicit_import: Option<Spanned<Id, BytePos>>, }, Tuple { typ: ArcType<Id>, elems: Vec<SpannedPattern<Id>>, }, Literal(Literal), Error, }
Variants
As(Id, Box<SpannedPattern<Id>>)
An as-pattern, eg. option @ { monoid, functor }
Constructor(TypedIdent<Id>, Vec<SpannedPattern<Id>>)
Constructor pattern, eg. Cons x xs
Ident(TypedIdent<Id>)
Ident pattern, eg: x
Record
Record pattern, eg. { x, y = foo }
Fields of Record
typ: ArcType<Id> | |
types: Vec<PatternField<Id, Id>> | |
fields: Vec<PatternField<Id, SpannedPattern<Id>>> | |
implicit_import: Option<Spanned<Id, BytePos>> |
Tuple
Tuple pattern, eg: (x, y)
Fields of Tuple
typ: ArcType<Id> | |
elems: Vec<SpannedPattern<Id>> |
Literal(Literal)
A literal pattern
Error
An invalid pattern
Trait Implementations
impl<Id: Clone> Clone for Pattern<Id>
[src]
impl<Id: Clone> Clone for Pattern<Id>
fn clone(&self) -> Pattern<Id>
[src]
fn clone(&self) -> Pattern<Id>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<Id: PartialEq> PartialEq for Pattern<Id>
[src]
impl<Id: PartialEq> PartialEq for Pattern<Id>
fn eq(&self, other: &Pattern<Id>) -> bool
[src]
fn eq(&self, other: &Pattern<Id>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Pattern<Id>) -> bool
[src]
fn ne(&self, other: &Pattern<Id>) -> bool
This method tests for !=
.
impl<Id: Debug> Debug for Pattern<Id>
[src]
impl<Id: Debug> Debug for Pattern<Id>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Typed for Pattern<Symbol>
[src]
impl Typed for Pattern<Symbol>