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

Helpers for composing RustQ splice replacements as plain keyword lists.

Splices use the same shape accepted by `RustQ.render/3`:

    [items: [RustQ.Rust.fragment(:item, "pub fn generated() {}")]]

`merge/1` also accepts nested splice sources, so manifests can compose output
from several generators without wrapper structs.

# `name`

```elixir
@type name() :: atom()
```

# `replacement`

```elixir
@type replacement() :: term() | [term()]
```

# `source`

```elixir
@type source() :: t() | map() | [source() | {name(), replacement()}]
```

# `t`

```elixir
@type t() :: keyword([term()])
```

# `append`

```elixir
@spec append(t(), name(), replacement()) :: t()
```

Appends replacement fragments to a splice name.

# `merge`

```elixir
@spec merge(source()) :: t()
```

Merges splice sources, concatenating duplicate names.

Accepts ordinary keywords, maps, or nested lists of splice sources:

    RustQ.Splice.merge([
      BaseGenerator.splices(schema),
      NativeGenerator.splices(schema),
      items: RustQ.Rust.fragment(:item, "pub fn generated() {}")
    ])

# `put`

```elixir
@spec put(t(), name(), replacement()) :: t()
```

Replaces all fragments for a splice name.

---

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