avm_cbor (avm_cbor v0.2.0)

View Source

Summary

Types

decode_result/0

-type decode_result() :: {ok, term(), binary()} | {error, term()}.

encode_result/0

-type encode_result() :: {ok, binary()} | {error, term()}.

Functions

arg(AddInfo, Bin)

as_bool(_)

-spec as_bool(term()) -> {ok, boolean()} | {error, bad_type}.

as_bytes(Bin)

-spec as_bytes(term()) -> {ok, binary()} | {error, bad_type}.

as_int(N)

-spec as_int(term()) -> {ok, integer()} | {error, bad_type}.

as_text(_)

-spec as_text(term()) -> {ok, binary()} | {error, bad_type}.

ble_options()

-spec ble_options() -> list().

check_depth(Depth, Cbor_opts)

check_deterministic_map_key(PreviousKeyBytes, CurrentKeyBytes)

check_item_limit(N, Cbor_opts)

check_max_bytes(Size, Cbor_opts)

check_preferred(MajorType, AddInfo, Arg, Opts)

check_string_byte_limit(N, Cbor_opts)

consume_node(State)

consume_string_bytes(Needed, State)

decode(Bin)

-spec decode(term()) -> decode_result().

decode(Bin, Opts)

-spec decode(term(), term()) -> decode_result().

decode_all(Bin)

-spec decode_all(term()) -> {ok, list()} | {error, term()}.

decode_all(Bin, Opts)

-spec decode_all(term(), term()) -> {ok, list()} | {error, term()}.

decode_continue(Continuation, Budget)

-spec decode_continue(term(), term()) -> {done, term(), binary()} | {more, term()} | {error, term()}.

decode_item(Bin, State, Depth)

decode_opts(Cbor_decode_state)

decode_sequence(Bin)

-spec decode_sequence(term()) -> {ok, list(), binary()} | {error, term()}.

decode_sequence(Bin, Opts)

-spec decode_sequence(term(), term()) -> {ok, list(), binary()} | {error, term()}.

decode_start(Bin, Opts)

-spec decode_start(term(), term()) -> {ok, term()} | {error, term()}.

encode(Val)

-spec encode(term()) -> encode_result().

encode(Val, Opts)

-spec encode(term(), list()) -> encode_result().

ensure_node_budget(Needed, Cbor_decode_state)

get(Key, _)

-spec get(term(), {map, list()}) -> {ok, term()} | error.

get(Key, _, Default)

-spec get(term(), {map, list()}, term()) -> term().

new_decode_state(Opts)

normalize_partial_opts(Opts)

partial_contents(Partial)

-spec partial_contents(term()) -> {ok, binary()} | {error, term()}.

partial_count(Partial)

-spec partial_count(term()) -> non_neg_integer() | undefined | {error, term()}.

partial_decode(Bin)

-spec partial_decode(term()) -> {ok, term(), binary()} | {error, term()}.

partial_decode(Bin, Opts)

-spec partial_decode(term(), term()) -> {ok, term(), binary()} | {error, term()}.

partial_deep_decode(Partial)

-spec partial_deep_decode(term()) -> {ok, term()} | {error, term()}.

partial_length(Partial)

-spec partial_length(term()) -> non_neg_integer() | {error, term()}.

partial_offset(Partial)

-spec partial_offset(term()) -> non_neg_integer() | {error, term()}.

partial_size(Partial)

-spec partial_size(term()) -> non_neg_integer() | undefined | {error, term()}.

partial_skip(Partial)

-spec partial_skip(term()) -> ok | {error, term()}.

partial_tag(Partial)

-spec partial_tag(term()) -> non_neg_integer() | undefined | {error, term()}.

partial_type(Partial)

-spec partial_type(term()) -> atom() | {error, term()}.

partial_value_bytes(Partial)

-spec partial_value_bytes(term()) -> binary() | {error, term()}.

require(Key, _)

-spec require(term(), {map, list()}) -> {ok, term()} | {error, {missing_key, term()}}.

requires_deterministic_decode(Opts)

simple(AddInfo, Val, Bin, Opts)

validate_utf8(_)