Expand description
Proc macros (design-doc §6). Two macros only, per the governing principle — a macro is justified only where Python used runtime dynamism Rust lacks:
#[rustdv::test](§6.1): registers the annotatedasync fnin the link-time test registry (theinventory/linkmetechnique, hand rolled for ELF:#[link_section]+__start_/__stop_symbols).#[derive(Component)](§6.3): generates theComponentNodetraversal over#[component]fields (T,Option<T>,Vec<T>).
Implementation note (STATUS.md): the zero-dependency constraint
rules out syn/quote, so parsing walks raw token trees and code
generation goes through string formatting + .parse(). Supported
grammar is deliberately narrow (plain fns, non-generic structs with
named fields); unsupported shapes produce compile errors.
Attribute Macros§
- test
- Both front doors (design-doc §6.1, D46). Registers at link time either
Derive Macros§
- Component
- Generates the
ComponentNodeimpl (design-doc §6.3, revised per R2): traversal of#[component]fields, includingOption<T>andVec<T>; names synthesized from field names. Emits no factory registration (R5) — but R5 is reversed: the factory returns in ch29, and this derive is where its registration will land. The impl is hand-writable; the derive is convenience.