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

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

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

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

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

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

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