Module core

Module core 

Source
Expand description

Type tags used in the senax binary format.

These tags are written as the first byte of each encoded value to identify its type and optimize decoding. Most users do not need to use these directly.

  • Primitives, Option, String, Vec, arrays, maps, structs, enums, and feature types each have their own tag(s).
  • Tags are stable and part of the wire format.

Constants§

TAG_ARRAY_VEC_SET_BASE
< Short array/vec/set (length in tag) - includes HashSet, BTreeSet, IndexSet, FxHashSet, AHashSet
TAG_ARRAY_VEC_SET_LONG
< Long array/vec/set (length encoded) - includes HashSet, BTreeSet, IndexSet, FxHashSet, AHashSet
TAG_BINARY
< Bytes
TAG_CHRONO_DATETIME
< chrono::DateTime
TAG_CHRONO_NAIVE_DATE
< chrono::NaiveDate
TAG_CHRONO_NAIVE_DATETIME
< chrono::NaiveDateTime
TAG_CHRONO_NAIVE_TIME
< chrono::NaiveTime
TAG_DECIMAL
< rust_decimal::Decimal
TAG_ENUM
TAG_ENUM_NAMED
< Enum with named fields
TAG_ENUM_UNNAMED
< Enum with tuple fields
TAG_F32
TAG_F64
TAG_JSON_ARRAY
TAG_JSON_BOOL
TAG_JSON_NULL
TAG_JSON_NUMBER
TAG_JSON_OBJECT
TAG_JSON_STRING
TAG_MAP
< Map (HashMap, BTreeMap, IndexMap, FxHashMap, AHashMap)
TAG_NEGATIVE
< Negative signed integer (bit-inverted encoding)
TAG_NONE
TAG_ONE
< 1 for numbers, true for bool
TAG_SOME
TAG_STRING_BASE
< Short string (length in tag) - String, SmolStr
TAG_STRING_LONG
< Long string (length encoded) - String, SmolStr
TAG_STRUCT_NAMED
< Named struct
TAG_STRUCT_UNIT
< Unit struct
TAG_STRUCT_UNNAMED
< Tuple struct
TAG_TUPLE
< Tuple
TAG_U8
TAG_U8_127
TAG_U16
TAG_U32
TAG_U64
TAG_U128
TAG_UUID
< uuid::Uuid, ulid::Ulid
TAG_ZERO
< 0 for numbers, false for bool

Functions§

read_field_id_optimized
Reads a field ID using optimized encoding.
read_u32_le
Reads a u32 in little-endian format without a tag.
read_u64_le
Reads a u64 in little-endian format without a tag.
skip_value
Skips a value of any type in the senax binary format.
write_field_id_optimized
Writes a u64 in little-endian format without a tag.
write_u32_le
Writes a u32 in little-endian format without a tag.
write_u64_le
Writes a u64 in little-endian format without a tag.