erl_cbor_decoding (erl_cbor v2.0.1)
Link to this section Summary
Link to this section Types
Link to this type
decoder/0
Specs
decoder() :: #decoder{}.
Link to this type
decoding_error/0
Specs
decoding_error() :: invalid_input_error() | truncated_input_error() | interpretation_error().
Link to this type
decoding_result/1
Specs
decoding_result(Decodable) :: {ok, Decodable, binary()} | {error, decoding_error()}.
Link to this type
interpretation_error/0
Specs
interpretation_error() :: term().
Link to this type
interpretation_result/1
Specs
interpretation_result(ValueType) :: {ok, ValueType} | {error, interpretation_error()}.
Link to this type
invalid_input_error/0
Specs
invalid_input_error() :: invalid_sequence_header | no_input | odd_number_of_map_values | {invalid_base64_data, {invalid_data, binary()} | {invalid_base64_digit, byte()}} | {invalid_base64url_data, {invalid_data, binary()} | {invalid_base64url_digit, byte()}} | {invalid_cbor_data, term()} | {invalid_tagged_value, tuple()} | {invalid_trailing_data, nonempty_binary()} | {invalid_type_tag, byte()}.
Link to this type
options/0
Specs
options() :: #{max_depth => non_neg_integer(), value_interpreters => #{erl_cbor:type() := value_interpreter()}}.
Link to this type
truncated_input_error/0
Specs
truncated_input_error() :: truncated_array | truncated_byte_string | truncated_float | truncated_map | truncated_negative_integer | truncated_sequence_header | truncated_simple_value | truncated_tagged_value | truncated_unsigned_integer | truncated_utf8_string.
Link to this type
value_interpreter/0
Specs
value_interpreter() :: fun((decoder(), erl_cbor:value()) -> interpretation_result(term())) | fun((erl_cbor:value()) -> interpretation_result(term())).
Link to this section Functions
Link to this function
decode(Decoder, Data)
Specs
decode(decoder(), binary()) -> decoding_result(term()).
Link to this function
decoder(Opts)
Specs
Link to this function
default_options()
Specs
default_options() -> options().
Link to this function
default_value_interpreters()
Specs
default_value_interpreters() -> #{erl_cbor:tag() := value_interpreter()}.