pub struct StructuredBlock {
    pub inputs: Vec<VariableId>,
    pub statements: Vec<Statement>,
    pub drops: Vec<VariableId>,
    pub end: StructuredBlockEnd,
}
Expand description

A block of statements. Each block gets inputs and outputs, and is composed of a linear sequence of statements.

A block may end with a return, which exits the current function.

A block contains the list of variables to be dropped at its end. Other than these variables and the output variables, it is guaranteed that no other variable is alive.

Fields§

§inputs: Vec<VariableId>

Input variables to the block, including implicits.

§statements: Vec<Statement>

Statements sequence running one after the other in the block, in a linear flow. Note: Inner blocks might end with a return, which will exit the function in the middle. Note: Match is a possible statement, which means it has control flow logic inside, but after its execution is completed, the flow returns to the following statement of the block.

§drops: Vec<VariableId>

Which variables are needed to be dropped at the end of this block. Note that these are not explicitly dropped by statements.

§end: StructuredBlockEnd

Describes how this block ends: returns to the caller or exits the function.

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 ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
The type returned in the event of a conversion error.
Performs the conversion.

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
Compare self to key and return true if they are equal.

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.