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

Rendering boundary for structural RustQ AST and explicit Rust fragments.

Build generated Rust with `RustQ.Rust.AST.Builder`, `ItemBuilder`,
`PatternBuilder`, and `TypeBuilder`. Keep those values structural until they
are passed to a RustQ template or explicitly rendered here.

Use `fragment/2` only for small Rust syntax escapes that RustQ cannot yet
represent as AST.

# `renderable`

```elixir
@type renderable() ::
  RustQ.Rust.AST.item()
  | RustQ.Rust.AST.stmt()
  | RustQ.Rust.AST.expr()
  | RustQ.Rust.AST.pat()
  | RustQ.Rust.AST.type()
  | RustQ.Rust.AST.StructField.t()
  | RustQ.Rust.AST.Arm.t()
  | RustQ.Rust.Fragment.t()
  | iodata()
```

# `fragment`

```elixir
@spec fragment(RustQ.Rust.Fragment.kind(), iodata()) :: RustQ.Rust.Fragment.t()
```

Builds an explicit Rust source fragment for a known splice context.

# `render`

```elixir
@spec render(renderable()) :: String.t()
```

Renders one Rust AST item, struct field, or explicit fragment.

# `render_all`

```elixir
@spec render_all([RustQ.Rust.AST.item() | RustQ.Rust.Fragment.t()]) :: String.t()
```

Renders a list of Rust items separated by blank lines.

# `render_type`

```elixir
@spec render_type(RustQ.Rust.AST.type() | atom() | String.t() | tuple() | [term()]) ::
  String.t()
```

Renders a structural Rust type.

---

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