Dextrin.Binary.Decoder (Dextrin v0.3.2)

Copy Markdown View Source

.dxnb decoder — the mirror image of Dextrin.Binary.Encoder. Envelope (magic version cbor_item) checked once at the top; everything below that is a single recursive decode_item/2, keyed on CBOR major type first, then on tag — matching DXN.md §2.2's table row order the same way the encoder does.

Summary

Functions

bin read as .dxnb documents back to back, each with its own envelope -- a CBOR sequence of documents, as a schema's encodes-seq: reads one (DXNS.md §2); no bytes at all are no documents.

Functions

decode(bin, opts \\ [])

@spec decode(binary(), keyword()) :: {:ok, term()} | {:error, Dextrin.Error.t()}

decode_sequence(bin, opts \\ [])

@spec decode_sequence(binary(), keyword()) ::
  {:ok, [term()]} | {:error, Dextrin.Error.t()}

bin read as .dxnb documents back to back, each with its own envelope -- a CBOR sequence of documents, as a schema's encodes-seq: reads one (DXNS.md §2); no bytes at all are no documents.