pub struct PatternSequence {
    pub insts: Vec<PatternInst>,
}
Expand description

A linear sequence of instructions that match on and destructure an argument. A pattern is fallible (may not match). If it does not fail, its result consists of the values produced by the PatternInsts, which may be used by a subsequent Expr.

Fields§

§insts: Vec<PatternInst>

Instruction sequence for pattern.

InstId indexes into this sequence for Value::Pattern values.

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
Returns the “default value” for a type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. 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
The type of subpattern identifiers.
Match if a and b have equal values.
Match if input is the given integer constant.
Match if input is the given primitive constant.
Match if input is the given enum variant. Returns an identifier for each field within the enum variant. The length of the return list must equal the length of arg_tys. Read more
Match if the given external extractor succeeds on input. Returns an identifier for each return value from the external extractor. The length of the return list must equal the length of output_tys. Read more
The type of pattern visitors constructed by RuleVisitor::add_pattern.
The type of expression visitors constructed by RuleVisitor::add_expr.
The type returned from RuleVisitor::add_expr, which may be exchanged for a subpattern identifier using RuleVisitor::expr_as_pattern. Read more
Visit one of the arguments to the top-level pattern.
Visit a pattern, used once for the rule’s left-hand side and once for each if-let. You can determine which part of the rule the pattern comes from based on whether the PatternId passed to the first call to this visitor came from add_arg or expr_as_pattern. Read more
Visit an expression, used once for each if-let and once for the rule’s right-hand side.
Given an expression from RuleVisitor::add_expr, return an identifier that can be used with a pattern visitor in RuleVisitor::add_pattern. Read more
Given an identifier from the pattern visitor, return an identifier that can be used with the expression visitor. 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.