Expand description
Proc-macro front-end for lattice-config’s declarative
option / group / overrides declarations (M.2.0+M.2.1, Design
B + D from docs/dev/architecture/mode-architecture.md discussion notes).
Three public macros:
-
options!— declares one or more typed options, each bound to a registeredOptionGroup. Supports doc-comment capture,#[aliases("...")],#[validate(fn_path)],#[name("...")](explicit display-name override), and#[customizable(bool)]. Self-registers each option vialinkme::distributed_sliceso the registry’s pre-mainboot walks the slice and inserts every option without a centralregister_core_optionscall. -
groups!— declares one or moreOptionGrouptypes. Emits a compile-timeconst fnbyte-walk assertion that each group’s display name does NOT end in-mode(the modes-vs-groups disambiguation rule,mode-architecture.md§6.7.1). -
overrides!— constructs a typedOptionOverrideSetfrom a list ofOptionDecl = valuepairs (M.2.1). Compile-time-checks that each value matches its declaration’sValuetype via a let-ascription intermediate. Optional#[priority(High)]/#[priority(Low)]attribute promotes individual entries. Used byMode::options()impls.
Both macros emit code that references absolute paths into
::lattice_config; the consumer crate must depend on
lattice-config. The host crate (lattice-config itself)
uses extern crate self as lattice_config; so the same
absolute paths resolve in its own code.
Macros§
- groups
- Declarative group declaration block. See
lattice_config::OptionGroupandlattice_config::groups!for the surface contract. - options
- Declarative option declaration block. See the trait doc on
lattice_config::OptionDecland the macro doc onlattice_config::options!for the surface contract. - overrides
- Construct a typed
OptionOverrideSetfor aMode::options()return.