Validation and normalization of BTOON decoding options.
Options
:dictionary- aBtoon.Dictionarysession dictionary shared with the encoder.StringRefids are resolved against the session entries first, then the per-message string table carried in the envelope.:schema- aBtoon.Schemaused to decode a tagless schema body when the envelope does not carry the schema flag (schema negotiated out of band). When the schema flag is set, the embedded schema always wins.:keys- how object keys are returned::strings(default),:atoms(usesString.to_atom/1) or:atoms!(usesString.to_existing_atom/1).:typed_arrays-:lists(default) materializesTypedArrayandObjectTablepayloads as lists;:viewsreturns the wrapper structs holding zero-copy sub-binary slices.:max_depth- maximum nesting depth for tagged values (default100).:max_string_size- maximum inline string size in bytes (default1_048_576).:max_binary_size- maximum binary size in bytes (default16_777_216).:max_container_count- maximum array/object/table count (default1_000_000).
Summary
Types
Validated decoding options.
Functions
Decodes a BTOON binary using pre-validated options.
Decodes a BTOON binary using pre-validated options, raising on error.
Returns the default validated options.
Validates decoding options.
Validates decoding options, raising ArgumentError on error.
Types
@type validated() :: %{ dictionary: ToonEx.Btoon.Dictionary.t() | nil, schema: ToonEx.Btoon.Schema.t() | nil, keys: :strings | :atoms | :atoms!, typed_arrays: :lists | :views, max_depth: pos_integer(), max_string_size: pos_integer(), max_binary_size: pos_integer(), max_container_count: pos_integer() }
Validated decoding options.
Functions
@spec decode_validated(binary(), validated()) :: {:ok, term()} | {:error, ToonEx.Btoon.DecodeError.t()}
Decodes a BTOON binary using pre-validated options.
This avoids re-validating options on each call, improving performance for repeated decoding with the same options.
Decodes a BTOON binary using pre-validated options, raising on error.
This avoids re-validating options on each call, improving performance for repeated decoding with the same options.
@spec defaults() :: validated()
Returns the default validated options.
Validates decoding options.
Returns {:ok, validated} or {:error, message}.
Validates decoding options, raising ArgumentError on error.