Skip to main content

Module format

Module format 

Source
Expand description

Wire format constants and documentation. Canonical binary format rules.

Version 0.1 intentionally defines one binary representation per supported value:

  • integers are fixed-width little-endian,
  • bool is exactly 0x00 or 0x01,
  • strings are UTF-8 bytes prefixed by a u32 little-endian byte length,
  • vectors are prefixed by a u32 little-endian item count,
  • Option<T> and Result<T, E> use one-byte tags,
  • fixed arrays and tuples encode fields in declaration order.

Floats, pointer-sized integers, hash maps, unordered maps, schema negotiation, and non-canonical alternatives are not part of this initial format. They are omitted because their representation or ordering can be platform-dependent, ambiguous, or outside this crate’s first-version scope.

Generic fixed-array decoding ([T; N]) requires the alloc feature in this version because the crate forbids unsafe code and Rust 1.85 does not provide a stable fallible array initializer. In no-alloc builds, [u8; N] decoding is available because it can be filled directly from the source without heap allocation.

Constants§

BOOL_FALSE
Tag used for false.
BOOL_TRUE
Tag used for true.
OPTION_NONE
Tag used for None.
OPTION_SOME
Tag used for Some.
RESULT_ERR
Tag used for Err.
RESULT_OK
Tag used for Ok.