Expand description
Persistent structural index (sidecar) for MessagePack documents.
Appends a compact field-offset table directly after the raw msgpack bytes. On read, O(log n) field lookup via pre-computed byte ranges — no map scanning.
§Layout
[original_msgpack_bytes][entry0][entry1]...[entryN][entry_count: u16 LE][MAGIC: u32 LE]Each entry is 16 bytes: field_name_hash(u64 LE) + value_offset(u32 LE) + value_len(u32 LE).
Entries are stored sorted by field_name_hash to enable binary search.
Magic: 0x4E494458 (“NIDX”).
Structs§
- Sidecar
Entry - A single sidecar index entry.
- Sidecar
Field Index - A field index backed by a parsed sidecar — provides the same
.get()API asFieldIndexwithout re-scanning the msgpack.
Functions§
- build_
sidecar - Build a sidecar-indexed document from raw msgpack bytes.
- field_
index_ from_ sidecar - Parse the sidecar entries from a buffer into a
SidecarFieldIndex. - has_
sidecar - Check whether
bufhas a valid sidecar index appended. - msgpack_
bytes - Return the raw msgpack slice from a buffer that may or may not have a sidecar.
- sidecar_
lookup - Look up a field’s byte range
(start, end)using the sidecar index.