Elixir patterns as Rust patterns: in case clauses, with clauses, bindings, closure
arguments, and comprehension generators.
Tuples, lists, structs, {:some, value}, {:ok, value}, {:error, reason}, atoms, and enum
variants lower to the Rust patterns matching the same values, by the type matched. Matching
binds the pattern's variables with the types it reveals, which the clause body lowers with.
Summary
Functions
Whether pattern only binds, so it cannot fail to match.
The variables pattern binds.
The variables ast borrows mut.
The variables a clause body changes among those its pattern binds.
context with the variables a generator pattern binds, typed by the items it matches.
context with the variables a binding pattern binds shadowing any of the same name.
context with the variables pattern binds, typed by the value of type it matches.
A pattern with its comprehension filters as its guard.
The type a case scrutinee has, as its clauses' patterns reveal it.
Whether pattern matches a list.
The Rust pattern a binding pattern is.
The Rust pattern a case pattern is, matching a value of type.
The Rust pattern a pattern over atoms and enum variants is.
The Rust pattern a with clause pattern is.
The variables a pattern binds, as one variable or a tuple of them.
The atom a pattern names, or a diagnostic for one it cannot.
A clause head split into its pattern and guard.
Whether case clauses match {:ok, _}/{:error, _} or {:some, _}/nil.
Functions
Whether pattern only binds, so it cannot fail to match.
The variables pattern binds.
The variables ast borrows mut.
The variables a clause body changes among those its pattern binds.
context with the variables a generator pattern binds, typed by the items it matches.
context with the variables a binding pattern binds shadowing any of the same name.
context with the variables pattern binds, typed by the value of type it matches.
A pattern with its comprehension filters as its guard.
The type a case scrutinee has, as its clauses' patterns reveal it.
Whether pattern matches a list.
The Rust pattern a binding pattern is.
The Rust pattern a case pattern is, matching a value of type.
The Rust pattern a pattern over atoms and enum variants is.
The Rust pattern a with clause pattern is.
The variables a pattern binds, as one variable or a tuple of them.
The atom a pattern names, or a diagnostic for one it cannot.
A clause head split into its pattern and guard.
Whether case clauses match {:ok, _}/{:error, _} or {:some, _}/nil.