# `RustQ.Meta.Lower`
[🔗](https://github.com/elixir-crab/rustq/blob/v1.0.0-rc.19/lib/rustq/meta/lower.ex#L1)

Lowers Rusty-Elixir to RustQ AST: expressions, statements, control flow, calls, and closures,
with the borrows, `?` propagation, and wrapping their expected types call for.

A body is first desugared by `RustQ.Meta.Desugar` and annotated by `RustQ.Meta.Ownership`.
Lowering then hands parts to the modules beside it, which call back into `lower_expr/2`:

  * `RustQ.Meta.Lower.Pattern` lowers patterns and binds their variables;
  * `RustQ.Meta.Lower.Comprehension` lowers comprehensions and `for` loops;
  * `RustQ.Meta.Lower.Paths` resolves aliases to Rust paths and calls to callables;
  * `RustQ.Meta.Lower.Mutability` marks what lowered Rust changes `mut`;
  * `RustQ.Meta.Lower.Stdlib` lowers calls into Elixir's standard library.

# `closure_arg!`

A closure argument, as a Rust closure argument: a name, or a binding pattern.

# `collection_item_type`

The item type of a list a comprehension builds.

# `enum_variant_path`

The Rust path of an enum variant written as `enum_variant(Enum, :variant)`.

# `enum_variant_path`

# `function_body`

```elixir
@spec function_body(Macro.t(), RustQ.Meta.Type.t(), map(), keyword()) :: String.t()
```

# `in_use?`

Whether a collection is still in use after this use of it; see `RustQ.Meta.Ownership`.

# `infer_expr_type`

The type of a variable in `vars`, or nil for another expression.

# `lower_binary_operand`

`expression`, lowered as an operand: a fallible one propagates its error with `?`.

# `lower_clause_body`

Lowers the body of a clause, expected to give `type` when known.

# `lower_clause_body`

# `lower_closure_args`

A closure taking `args` and returning `body`, as a value of `expected_return_type` when given.

# `lower_closure_body`

A closure's `body`, lowered to return a value of `expected_return_type` when given.

# `lower_expr`

Lowers an expression, as the `RustQ.Meta.Lower.*` modules lowering its parts call back.

# `lower_expr`

# `lower_function_capture`

A captured named function, as the Rust path of that function.

# `lower_return_expr`

Lowers an expression in return position.

# `quoted_body`

```elixir
@spec quoted_body(Macro.t(), RustQ.Meta.Type.t() | nil, map(), keyword()) :: [
  struct()
]
```

# `rust_enum_variant`

The Rust enum variant path an atom of an enum type names.

# `rust_variant`

The Rust variant name an Elixir atom names, in Rust case.

# `slice_type?`

Whether `type` is a slice or a reference to one.

# `typing_env`

The `RustQ.Meta.Typing` environment of a lowering context.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
