Enum gluon_base::ast::Pattern
source · pub enum Pattern<'ast, Id> {
As(Spanned<Id, BytePos>, &'ast mut SpannedPattern<'ast, Id>),
Constructor(TypedIdent<Id>, &'ast mut [SpannedPattern<'ast, Id>]),
Ident(TypedIdent<Id>),
Record {
typ: ArcType<Id>,
fields: &'ast mut [PatternField<'ast, Id>],
implicit_import: Option<Spanned<Id, BytePos>>,
},
Tuple {
typ: ArcType<Id>,
elems: &'ast mut [SpannedPattern<'ast, Id>],
},
Literal(Literal),
Error,
}
Variants§
As(Spanned<Id, BytePos>, &'ast mut SpannedPattern<'ast, Id>)
An as-pattern, eg. option @ { monoid, functor }
Constructor(TypedIdent<Id>, &'ast mut [SpannedPattern<'ast, Id>])
Constructor pattern, eg. Cons x xs
Ident(TypedIdent<Id>)
Ident pattern, eg: x
Record
Fields
§
fields: &'ast mut [PatternField<'ast, Id>]
Record pattern, eg. { x, y = foo }
Tuple
Tuple pattern, eg: (x, y)
Literal(Literal)
A literal pattern
Error
An invalid pattern
Trait Implementations§
source§impl<'ast, Id: PartialEq> PartialEq for Pattern<'ast, Id>
impl<'ast, Id: PartialEq> PartialEq for Pattern<'ast, Id>
impl<'ast, Id: Eq> Eq for Pattern<'ast, Id>
impl<'ast, Id> StructuralEq for Pattern<'ast, Id>
impl<'ast, Id> StructuralPartialEq for Pattern<'ast, Id>
Auto Trait Implementations§
impl<'ast, Id> RefUnwindSafe for Pattern<'ast, Id>where
Id: RefUnwindSafe,
impl<'ast, Id> Send for Pattern<'ast, Id>
impl<'ast, Id> Sync for Pattern<'ast, Id>
impl<'ast, Id> Unpin for Pattern<'ast, Id>where
Id: Unpin,
impl<'ast, Id> !UnwindSafe for Pattern<'ast, Id>
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