ToonEx.Btoon.Constants (toon_ex v1.3.1)

Copy Markdown View Source

Binary constants for the BTOON wire format.

BTOON is the binary transport encoding of the TOON data model (see Btoon). This module defines the byte-level constants: the envelope magic/version, flag bits, value type tags and typed-array / schema element type selectors.

Envelope

+------------------+
| Magic "BTON"     |  4 bytes
+------------------+
| Version          |  1 byte
+------------------+
| Flags            |  1 byte
+------------------+
| Reserved         |  2 bytes (MUST be zero)
+------------------+
| String Table     |  variable, zero-padded to a multiple of 8 bytes
+------------------+
| Schema           |  variable (only when the schema flag is set)
+------------------+
| Body             |  variable, 8-byte aligned
+------------------+

Flags

bit0 (0x01) reserved
bit1 (0x02) schema included
bit2 (0x04) string table present
bit3 (0x08) session dictionary active
bit4 (0x10) no per-message string table
bit5 (0x20) schema ID is UInt16
bits6-7      reserved

Summary

Functions

element_array()

element_binary()

element_bool()

element_float32()

element_float64()

element_int8()

element_int16()

element_int32()

element_int64()

element_null()

element_object()

element_string()

element_uint8()

element_uint16()

element_uint32()

element_uint64()

flag_no_string_table()

flag_schema()

flag_schema_id_uint16()

flag_session_dictionary()

flag_string_table()

header_size()

int32_max()

int32_min()

magic()

reserved()

smallint_bias()

smallint_first()

smallint_last()

smallint_max()

smallint_min()

tag_array()

tag_binary()

tag_false()

tag_float32()

tag_float64()

tag_int32()

tag_int64()

tag_null()

tag_object()

tag_object_table()

tag_string()

tag_string_ref()

tag_true()

tag_typed_array()

type_tag(arg1)

@spec type_tag(atom()) :: byte()

Returns the type tag for a BTOON primitive value tag.

version()