# `QuackDB.Protocol.Writer`
[🔗](https://github.com/elixir-vibe/quackdb/blob/main/lib/quack_db/protocol/writer.ex#L1)

Binary writer primitives for the Quack wire format.

Builds field-tagged objects and scalar encodings used by message codecs while
returning iodata so callers can avoid unnecessary binary copies.

# `blob`

```elixir
@spec blob(binary()) :: iodata()
```

# `bool`

```elixir
@spec bool(boolean()) :: &lt;&lt;_::8&gt;&gt;
```

# `end_object`

```elixir
@spec end_object() :: &lt;&lt;_::16&gt;&gt;
```

# `field`

```elixir
@spec field(non_neg_integer(), iodata()) :: iodata()
```

# `hugeint`

```elixir
@spec hugeint(integer()) :: iodata()
```

# `list`

```elixir
@spec list([value], (value -&gt; iodata())) :: iodata() when value: term()
```

# `nullable`

```elixir
@spec nullable(value | nil, (value -&gt; iodata())) :: iodata() when value: term()
```

# `optional_index`

```elixir
@spec optional_index(non_neg_integer() | nil) :: iodata()
```

# `sleb128`

```elixir
@spec sleb128(integer()) :: iodata()
```

# `string`

```elixir
@spec string(String.t()) :: iodata()
```

# `uleb128`

```elixir
@spec uleb128(non_neg_integer()) :: iodata()
```

---

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