PhoenixGenApi.ImplHelper (PhoenixGenApi v2.15.0)

Copy Markdown View Source

Macro to generate simple implementation of protocol. Support for easy to use with general encoder.

Utility macro to generate implementation for struct.

The target struct must have encode!/2 function in module.

Usage:

use PhoenixGenApi.ImplHelper, encoder: JSON.Encoder, impl: [AModule1, AModule2, ...]

Using macro without option in use keyword. Target module must have encode!/2 function Generate implementation from struct for JSON.Encoder like this:

require PhoenixGenApi.ImplHelper

gen_impl JSON.Encoder, AModule

Summary

Functions

gen_impl(encoder, module)

(macro)