View Source euneus_encoder (euneus v0.4.0)
Summary
Types
-type encoder(Input) :: fun((Input, options()) -> iolist()).
-type error_class() :: error | exit | throw.
-type error_handler() :: fun((error_class(), error_reason(), error_stacktrace(), input(), options()) -> error_stacktrace()).
-type error_reason() ::
{unsupported_type, Unsupported :: term()} | {invalid_byte, Byte :: byte(), Input :: binary()}.
-type error_stacktrace() :: erlang:stacktrace().
-type escaper(Input) :: fun((Input, options()) -> iolist()).
-type input() :: term().
-type options() :: #{nulls => list(), binary_encoder => encoder(Input :: binary()), atom_encoder => encoder(Input :: atom()), integer_encoder => encoder(Input :: integer()), float_encoder => encoder(Input :: float()), list_encoder => encoder(Input :: list()), map_encoder => encoder(Input :: map()), datetime_encoder => encoder(Input :: calendar:datetime()), timestamp_encoder => encoder(Input :: erlang:timestamp()), unhandled_encoder => encoder(Input :: term()), escaper => escaper(Input :: binary()), error_handler => error_handler()}.
-type result() :: {ok, iolist()} | {error, error_reason()}.