Enum cranelift_isle::sema::Pattern[][src]

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

A left-hand side pattern of some rule.

Variants

BindPattern(TypeIdVarIdBox<Pattern>)

Tuple Fields

0: TypeId
1: VarId

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

Keep matching on the value with the subpattern.

Var(TypeIdVarId)

Tuple Fields

0: TypeId
1: VarId

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

ConstInt(TypeIdi64)

Tuple Fields

0: TypeId
1: i64

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

ConstPrim(TypeIdSym)

Tuple Fields

0: TypeId
1: Sym

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

Term(TypeIdTermIdVec<TermArgPattern>)

Tuple Fields

0: TypeId
1: TermId

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

Wildcard(TypeId)

Tuple Fields

0: TypeId

Match anything of the given type successfully.

And(TypeIdVec<Pattern>)

Tuple Fields

0: TypeId

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.

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 !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.