1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! The compact snapshot container (format version 3).
//!
//! A container holds one or more official editions over shared tables:
//!
//! 1. a string table holding every string the container's distinct records
//! use more than once, each stored once, most used first (ties by byte
//! order) so the commonest take a one-byte reference;
//! 2. property, quantity and set records, each distinct record stored once
//! across every edition in the container and referenced by index;
//! 3. one entry per edition: its [`SourceManifest`] and its sets in order.
//!
//! A string field is a slot: absent (`0`), inline text (`1`, length,
//! UTF-8), inline hexadecimal (`2`, length, bytes) or a table entry
//! (`3 + index`). A string used once stays inline next to the text around
//! it, which keeps the container as compressible as the text itself. A
//! lowercase hexadecimal string (a GUID or SHA-256), inline or in the
//! table, is stored as its bytes and read back as the same text.
//!
//! Integers are unsigned LEB128. Each record carries its length, so
//! decoding one edition of a container reads only that edition's records.
//! A complex property refers only to records before it, so the record
//! graph is acyclic by construction.
//!
//! The encoding is a lossless format shift: decoding yields exactly the
//! templates and manifests that were encoded, field for field. The encoder
//! is deterministic: equal input produces equal bytes.
pub use ;
pub use encode;
use crateCatalogError;
/// Leading magic shared with the earlier bincode artifacts.
pub const MAGIC: = *b"NEHPSDQ\0";
/// The container version this build reads and writes.
pub const FORMAT_VERSION: u64 = 3;
/// Resource budget for one container.
pub const MAX_BYTES: usize = 8 * 1024 * 1024;
/// Why a container could not be read.
pub
/// A string slot: absent, inline text, inline hexadecimal bytes, or a
/// table entry (`SLOT_TABLE + index`).
pub const SLOT_ABSENT: u64 = 0;
pub const SLOT_TEXT: u64 = 1;
pub const SLOT_HEX: u64 = 2;
pub const SLOT_TABLE: u64 = 3;