ExWapp.JSON.Library behaviour (ExWapp v0.1.2)

Copy Markdown View Source

Contract expected from the configured JSON implementation.

A library does not have to declare this behaviour explicitly. An adapter module is sufficient when its native API has a different return shape.

Summary

Types

reason()

@type reason() :: term()

Callbacks

decode(iodata)

@callback decode(iodata()) :: {:ok, term()} | {:error, reason()}

encode(term)

@callback encode(term()) :: {:ok, iodata()} | {:error, reason()}