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

The behaviour to implement when wrapping a JSON library.

Summary

Callbacks

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

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

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