[][src]Enum gluon_base::ast::Pattern

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

Record pattern, eg. { x, y = foo }

Fields of Record

typ: ArcType<Id>fields: &'ast mut [PatternField<'ast, Id>]implicit_import: Option<Spanned<Id, BytePos>>
Tuple

Tuple pattern, eg: (x, y)

Fields of Tuple

typ: ArcType<Id>elems: &'ast mut [SpannedPattern<'ast, Id>]
Literal(Literal)

A literal pattern

Error

An invalid pattern

Trait Implementations

impl<'ast, Id> AstClone<'ast, Id> for Pattern<'ast, Id> where
    Id: AstClone<'ast, Id>,
    Id: Clone
[src]

impl<'ast, Id: Debug> Debug for Pattern<'ast, Id>[src]

impl<Id, '_> Default for Pattern<'_, Id>[src]

impl<'ast, Id: Eq> Eq for Pattern<'ast, Id>[src]

impl<'ast, Id: PartialEq> PartialEq<Pattern<'ast, Id>> for Pattern<'ast, Id>[src]

impl<'ast, Id> StructuralEq for Pattern<'ast, Id>[src]

impl<'ast, Id> StructuralPartialEq for Pattern<'ast, Id>[src]

impl<'_> Typed for Pattern<'_, Symbol>[src]

type Ident = Symbol

Auto Trait Implementations

impl<'ast, Id> RefUnwindSafe for Pattern<'ast, Id> where
    Id: RefUnwindSafe

impl<'ast, Id> Send for Pattern<'ast, Id> where
    Id: Send + Sync

impl<'ast, Id> Sync for Pattern<'ast, Id> where
    Id: Send + Sync

impl<'ast, Id> Unpin for Pattern<'ast, Id> where
    Id: Unpin

impl<'ast, Id> !UnwindSafe for Pattern<'ast, Id>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Id> AsId<Id> for Id where
    Id: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.