What
The datum-macro skill covers three tiers of using Rust macros as dynamic datums, all operating at compile time. Tier 1 uses macro_rules! to create BootDatum literals at compile time with zero new dependencies — useful for core datums baked into the binary. Tier 2 uses the inventory crate for distributed static collection where any crate registers a datum at link time and inventory::iter::<BootDatum> collects all registered datums without file I/O — this enables offline/airgap binaries with core datums baked in. Tier 3 uses a proc_macro attribute (#[b00t_datum(type = "cli", hint = "...")]) which is the most ergonomic but requires a new crate.
The Chalk Interner pattern connects here: a DatumStore trait would unify all three tiers, with implementations for TomlFileStore, InventoryStore, SqliteStore, and QdrantStore. Macros register into InventoryStore; the TOML scanner registers into TomlFileStore; get_all_datums() merges both with operator-added datums overriding builtins by key.
When to Use
Use Tier 1 (macro_rules!) when you need to define core datums inline without dependencies. Use Tier 2 (inventory) when building offline/airgap binaries with blessed tooling baked in. Use Tier 3 (proc_macro) when ergonomics matter more than dependency footprint.
How
- For Tier 1: define a
macro_rules! datum { ... }that createsBootDatumliterals. UseLazyLocksinceBootDatumusesString. - For Tier 2: add
inventoryas an optional feature flag. Useinventory::submit!in any crate andinventory::iter::<BootDatum>inget_all_datums(). - For Tier 3: create a proc_macro crate with
#[b00t_datum(...)]attribute that generatesBootDatumconstruction +inventory::submit!. - Note: macros are compile-time only. TOML scan remains canonical for operator-extensible datums.