Protox.JsonLibrary behaviour (Protox v1.6.4) View Source

The behaviour to implement when wrapping a JSON library.

Link to this section Summary

Callbacks

Should wrap any exception of the underlying library in Protox.JsonDecodingError.

Should wrap any exception of the underlying library in Protox.JsonEncodingError.

Link to this section Callbacks

Specs

decode!(atom(), iodata()) :: term() | no_return()

Should wrap any exception of the underlying library in Protox.JsonDecodingError.

Specs

encode!(atom(), term()) :: iodata() | no_return()

Should wrap any exception of the underlying library in Protox.JsonEncodingError.

Specs

load() :: {:ok, atom()} | :error