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.Patternlowers patterns and binds their variables;RustQ.Meta.Lower.Comprehensionlowers comprehensions andforloops;RustQ.Meta.Lower.Pathsresolves aliases to Rust paths and calls to callables;RustQ.Meta.Lower.Mutabilitymarks what lowered Rust changesmut;RustQ.Meta.Lower.Stdliblowers calls into Elixir's standard library.
Summary
Functions
A closure argument, as a Rust closure argument: a name, or a binding pattern.
The item type of a list a comprehension builds.
The Rust path of an enum variant written as enum_variant(Enum, :variant).
Whether a collection is still in use after this use of it; see RustQ.Meta.Ownership.
The type of a variable in vars, or nil for another expression.
expression, lowered as an operand: a fallible one propagates its error with ?.
Lowers the body of a clause, expected to give type when known.
A closure taking args and returning body, as a value of expected_return_type when given.
A closure's body, lowered to return a value of expected_return_type when given.
Lowers an expression, as the RustQ.Meta.Lower.* modules lowering its parts call back.
A captured named function, as the Rust path of that function.
Lowers an expression in return position.
The Rust enum variant path an atom of an enum type names.
The Rust variant name an Elixir atom names, in Rust case.
Whether type is a slice or a reference to one.
The RustQ.Meta.Typing environment of a lowering context.
Functions
A closure argument, as a Rust closure argument: a name, or a binding pattern.
The item type of a list a comprehension builds.
The Rust path of an enum variant written as enum_variant(Enum, :variant).
@spec function_body(Macro.t(), RustQ.Meta.Type.t(), map(), keyword()) :: String.t()
Whether a collection is still in use after this use of it; see RustQ.Meta.Ownership.
The type of a variable in vars, or nil for another expression.
expression, lowered as an operand: a fallible one propagates its error with ?.
Lowers the body of a clause, expected to give type when known.
A closure taking args and returning body, as a value of expected_return_type when given.
A closure's body, lowered to return a value of expected_return_type when given.
Lowers an expression, as the RustQ.Meta.Lower.* modules lowering its parts call back.
A captured named function, as the Rust path of that function.
Lowers an expression in return position.
@spec quoted_body(Macro.t(), RustQ.Meta.Type.t() | nil, map(), keyword()) :: [ struct() ]
The Rust enum variant path an atom of an enum type names.
The Rust variant name an Elixir atom names, in Rust case.
Whether type is a slice or a reference to one.
The RustQ.Meta.Typing environment of a lowering context.