facet_msgpack/constants.rs
1/// MessagePack type tags
2/// As defined in the MessagePack specification: <https://github.com/msgpack/msgpack/blob/master/spec.md>
3/// Nil format - Represents nil/null values
4/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-nil>
5pub const MSGPACK_NIL: u8 = 0xc0;
6
7/// Boolean format family - Represents true/false values
8/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-bool>
9pub const MSGPACK_FALSE: u8 = 0xc2;
10/// Boolean true value in MessagePack format (0xc3)
11pub const MSGPACK_TRUE: u8 = 0xc3;
12
13/// Binary format family - Represents byte arrays
14/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-bin>
15pub const MSGPACK_BIN8: u8 = 0xc4;
16/// Binary format for arrays between 2^8 and 2^16-1 bytes (0xc5)
17pub const MSGPACK_BIN16: u8 = 0xc5;
18/// Binary format for arrays between 2^16 and 2^32-1 bytes (0xc6)
19pub const MSGPACK_BIN32: u8 = 0xc6;
20
21/// Extension format family - Represents custom type information with byte arrays
22/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-ext>
23pub const MSGPACK_EXT8: u8 = 0xc7;
24/// Extension format for data between 2^8 and 2^16-1 bytes (0xc8)
25pub const MSGPACK_EXT16: u8 = 0xc8;
26/// Extension format for data between 2^16 and 2^32-1 bytes (0xc9)
27pub const MSGPACK_EXT32: u8 = 0xc9;
28
29/// Float format family - Represents IEEE 754 floating point numbers
30/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-float>
31pub const MSGPACK_FLOAT32: u8 = 0xca;
32/// Double precision floating point number format (0xcb)
33pub const MSGPACK_FLOAT64: u8 = 0xcb;
34/// Unsigned integer format family - Represents unsigned integers
35/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#int-format-family>
36pub const MSGPACK_UINT8: u8 = 0xcc;
37/// 16-bit unsigned integer format (0xcd)
38pub const MSGPACK_UINT16: u8 = 0xcd;
39/// 32-bit unsigned integer format (0xce)
40pub const MSGPACK_UINT32: u8 = 0xce;
41/// 64-bit unsigned integer format (0xcf)
42pub const MSGPACK_UINT64: u8 = 0xcf;
43
44/// Signed integer format family - Represents signed integers
45/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#int-format-family>
46pub const MSGPACK_INT8: u8 = 0xd0;
47/// 16-bit signed integer format (0xd1)
48pub const MSGPACK_INT16: u8 = 0xd1;
49/// 32-bit signed integer format (0xd2)
50pub const MSGPACK_INT32: u8 = 0xd2;
51/// 64-bit signed integer format (0xd3)
52pub const MSGPACK_INT64: u8 = 0xd3;
53
54/// Fixed-size extension format family - Represents custom type information with fixed-size byte arrays
55/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-ext>
56pub const MSGPACK_FIXEXT1: u8 = 0xd4;
57/// Fixed-size 2-byte extension format (0xd5)
58pub const MSGPACK_FIXEXT2: u8 = 0xd5;
59/// Fixed-size 4-byte extension format (0xd6)
60pub const MSGPACK_FIXEXT4: u8 = 0xd6;
61/// Fixed-size 8-byte extension format (0xd7)
62pub const MSGPACK_FIXEXT8: u8 = 0xd7;
63/// Fixed-size 16-byte extension format (0xd8)
64pub const MSGPACK_FIXEXT16: u8 = 0xd8;
65
66/// String format family - Represents UTF-8 string
67/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-str>
68pub const MSGPACK_STR8: u8 = 0xd9;
69/// String format for strings between 2^8 and 2^16-1 bytes (0xda)
70pub const MSGPACK_STR16: u8 = 0xda;
71/// String format for strings between 2^16 and 2^32-1 bytes (0xdb)
72pub const MSGPACK_STR32: u8 = 0xdb;
73
74/// Array format family - Represents arrays of arbitrary values
75/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-array>
76pub const MSGPACK_ARRAY16: u8 = 0xdc;
77/// Array format for arrays with between 2^16 and 2^32-1 elements (0xdd)
78pub const MSGPACK_ARRAY32: u8 = 0xdd;
79
80/// Map format family - Represents key-value maps
81/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-map>
82pub const MSGPACK_MAP16: u8 = 0xde;
83/// Map format for maps with between 2^16 and 2^32-1 key-value pairs (0xdf)
84pub const MSGPACK_MAP32: u8 = 0xdf;
85
86/// Positive fixint format family - Represents positive integers from 0 to 127 in a single byte
87/// The first bit is 0, and the remaining 7 bits store the value
88/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#int-format-family>
89pub const MSGPACK_POSFIXINT_MIN: u8 = 0x00;
90/// Maximum value for positive fixint format (0x7f = 127)
91pub const MSGPACK_POSFIXINT_MAX: u8 = 0x7f;
92
93/// Negative fixint format family - Represents negative integers from -1 to -32 in a single byte
94/// The first 3 bits are 111, and the remaining 5 bits store the absolute value minus 1
95/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#int-format-family>
96pub const MSGPACK_NEGFIXINT_MIN: i8 = -0x20;
97/// Maximum value for negative fixint format (-0x01 = -1)
98pub const MSGPACK_NEGFIXINT_MAX: i8 = -0x01;
99
100/// Fixstr format family - Represents strings up to 31 bytes in a compact format
101/// The first 3 bits are 101, and the remaining 5 bits store the length
102/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-str>
103pub const MSGPACK_FIXSTR_MIN: u8 = 0xa0;
104/// Maximum value for fixstr format (0xbf, allowing strings up to 31 bytes)
105pub const MSGPACK_FIXSTR_MAX: u8 = 0xbf;
106
107/// Fixarray format family - Represents arrays with up to 15 elements in a compact format
108/// The first 4 bits are 1001, and the remaining 4 bits store the length
109/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-array>
110pub const MSGPACK_FIXARRAY_MIN: u8 = 0x90;
111/// Maximum value for fixarray format (0x9f, allowing arrays up to 15 elements)
112pub const MSGPACK_FIXARRAY_MAX: u8 = 0x9f;
113
114/// Fixmap format family - Represents maps with up to 15 key-value pairs in a compact format
115/// The first 4 bits are 1000, and the remaining 4 bits store the length
116/// Ref: <https://github.com/msgpack/msgpack/blob/master/spec.md#formats-map>
117pub const MSGPACK_FIXMAP_MIN: u8 = 0x80;
118/// Maximum value for fixmap format (0x8f, allowing maps up to 15 key-value pairs)
119pub const MSGPACK_FIXMAP_MAX: u8 = 0x8f;