Struct hir_def::body::Body[][src]

pub struct Body {
    pub exprs: Arena<Expr>,
    pub pats: Arena<Pat>,
    pub labels: Arena<Label>,
    pub params: Vec<PatId>,
    pub body_expr: ExprId,
    // some fields omitted
}
Expand description

The body of an item (function, const etc.).

Fields

exprs: Arena<Expr>pats: Arena<Pat>labels: Arena<Label>params: Vec<PatId>

The patterns for the function’s parameters. While the parameter types are part of the function signature, the patterns are not (they don’t change the external type of the function).

If this Body is for the body of a constant, this will just be empty.

body_expr: ExprId

The ExprId of the actual body expression.

Implementations

Returns an iterator over all block expressions in this body that define inner items.

Trait Implementations

Formats the value using the given formatter. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. 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

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more