# `RustQ.Rust.AST.Walk`
[🔗](https://github.com/dannote/rustq/blob/v0.11.1/lib/rustq/rust/ast/walk.ex#L1)

Generic traversal helpers for RustQ AST nodes.

Traversal is driven by RustQ AST node structs, so passes do not need to
hand-maintain structural recursion every time a node gains a field.

# `ast_node`

```elixir
@type ast_node() :: struct()
```

# `node?`

```elixir
@spec node?(term()) :: boolean()
```

Returns true when `term` is one of RustQ's schema-backed AST nodes.

# `postwalk`

```elixir
@spec postwalk(term(), (term() -&gt; term())) :: term()
```

Walks an AST tree in post-order, applying `fun` after children are visited.

# `prewalk`

```elixir
@spec prewalk(term(), (term() -&gt; term())) :: term()
```

Walks an AST tree in pre-order, applying `fun` before children are visited.

# `reduce`

```elixir
@spec reduce(term(), acc, (term(), acc -&gt; acc)) :: acc when acc: term()
```

Reduces an AST tree in pre-order.

---

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