# `ToonEx.Btoon.ImplHelper`
[🔗](https://github.com/ohhi-vn/toon_ex/blob/v1.6.0/lib/toon_ex/btoon/impl/impl_helper.ex#L1)

Helper macro for generating ToonEx.Btoon.Encoder protocol implementations.

Allows modules to easily implement the ToonEx.Btoon.Encoder protocol by
providing a list of modules that have an `encode!` function. Mirrors
`ToonEx.Btoon.ImplHelper` for the TOON text encoder, but targets the BTOON
binary `ToonEx.Btoon.Encoder` protocol instead.

## Usage

The target struct must have an `encode!` function for real encoding of the
struct data to BTOON in the module, returning a BTOON-encodable term (such
as a map with string keys):

```Elixir
use ToonEx.Btoon.ImplHelper, impl: [AModule1, AModule2, ...]
```

or directly:

```Elixir
ToonEx.Btoon.ImplHelper.gen_impl AModule
```

# `gen_impl`
*macro* 

---

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