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

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.

# `binding_pattern?`

Whether `pattern` only binds, so it cannot fail to match.

# `binding_pattern_names`

The variables `pattern` binds.

# `collect_mut_refs`

The variables `ast` borrows `mut`.

# `collect_pattern_mutations`

The variables a clause body changes among those its pattern binds.

# `context_with_for_pattern`

`context` with the variables a generator pattern binds, typed by the items it matches.

# `context_with_lexical_pattern_vars`

`context` with the variables a binding pattern binds shadowing any of the same name.

# `context_with_match_pattern`

`context` with the variables `pattern` binds, typed by the value of `type` it matches.

# `guarded_pattern`

A pattern with its comprehension filters as its guard.

# `infer_case_type_from_patterns`

The type a `case` scrutinee has, as its clauses' patterns reveal it.

# `list_pattern?`

Whether `pattern` matches a list.

# `lower_binding_pattern`

The Rust pattern a binding pattern is.

# `lower_match_pattern`

# `lower_match_pattern`

The Rust pattern a `case` pattern is, matching a value of `type`.

# `lower_semantic_pat`

The Rust pattern a pattern over atoms and enum variants is.

# `lower_with_pattern`

The Rust pattern a `with` clause pattern is.

# `pattern_binder`

The variables a pattern binds, as one variable or a tuple of them.

# `semantic_atom!`

The atom a pattern names, or a diagnostic for one it cannot.

# `split_guarded_pattern`

A clause head split into its pattern and guard.

# `wrapper_case_patterns?`

Whether `case` clauses match `{:ok, _}`/`{:error, _}` or `{:some, _}`/`nil`.

---

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