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
60
61
62
63
64
65
66
67
68
69
70
71
72
//! faf-fafb — FAFb v2, the compiled binary form of `.faf`.
//!
//! IFF-inspired chunked binary: a string table for section names, a section
//! table at the end for O(1) random access, classification bits (DNA /
//! Context / Pointer), priority-based truncation, and a CRC32 seal over the
//! source `.faf`.
//!
//! **Closed canonical.** The writer emits exactly the canonical chunk set
//! (see [`canon`]), in canonical order; non-canonical top-level keys fold into
//! the `context` chunk. Identical content produces byte-identical output
//! regardless of input key order — so a `.fafb` is content-addressable: the
//! same project context yields the same hash, everywhere. The reader keeps the
//! IFF rule (skip unknown section names gracefully), so a future minor version
//! can add a chunk without breaking deployed readers.
//!
//! **v2 only.** FAFb v1 is pre-release history and is rejected on read
//! (`IncompatibleVersion`) — re-compile from the `.faf` source, which is always
//! the source of truth.
//!
//! **Stability — FAFb wire v2 is frozen.** The byte layout is immutable,
//! enforced by a byte-exact golden-master test in this crate (`compile()` must
//! reproduce the vendored `.fafb` byte-for-byte; any structural change is caught
//! immediately). New capabilities ship only as forward-compatible additions —
//! chunks or flag bits older readers skip; we do not break v2. Because the
//! `.faf` source is always authoritative, you recompile, never migrate —
//! nothing gets trapped in an old binary.
//!
//! ## Usage
//!
//! ```rust
//! use faf_fafb::{compile, decompile, CompileOptions};
//!
//! let yaml = "faf_version: 2.5.0\nproject:\n name: my-project\n";
//! let opts = CompileOptions { use_timestamp: false };
//! let bytes = compile(yaml, &opts).unwrap();
//! let result = decompile(&bytes).unwrap();
//! let name = result.get_section_string_by_name("project").unwrap();
//! assert!(name.contains("my-project"));
//! ```
// Re-exports for convenience
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use StringTable;
/// Library version
pub const VERSION: &str = env!;