pub enum Pattern {
    BindPattern(TypeIdVarIdBox<Pattern>),
    Var(TypeIdVarId),
    ConstInt(TypeIdi128),
    ConstPrim(TypeIdSym),
    Term(TypeIdTermIdVec<Pattern>),
    Wildcard(TypeId),
    And(TypeIdVec<Pattern>),
}
Expand description

A left-hand side pattern of some rule.

Variants§

§

BindPattern(TypeIdVarIdBox<Pattern>)

Bind a variable of the given type from the current value.

Keep matching on the value with the subpattern.

§

Var(TypeIdVarId)

Match the current value against an already bound variable with the given type.

§

ConstInt(TypeIdi128)

Match the current value against a constant integer of the given integer type.

§

ConstPrim(TypeIdSym)

Match the current value against a constant primitive value of the given primitive type.

§

Term(TypeIdTermIdVec<Pattern>)

Match the current value against the given extractor term with the given arguments.

§

Wildcard(TypeId)

Match anything of the given type successfully.

§

And(TypeIdVec<Pattern>)

Match all of the following patterns of the given type.

Implementations§

Get this pattern’s type.

Get the root term of this pattern, if any.

Recursively visit every sub-pattern.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.