Macro products
macro_rules! products {
($d:tt $( $(#[$doc:meta])* $variant:ident($ty:ty) => $name:literal, )+) => { ... };
}Expand description
Declares the built-in products once. From one list it derives the enum, the
runtime name AnyInstrument::product_name returns, the
AnyInstrument::PRODUCT_NAMES a caller resolves against, and dispatch!,
which writes the forwarding match every per-product method delegates
through.
Hand-kept statements of the same list are how the list drifts: five products
once reached master priceable but unnameable, and every new product touched
four pricer matches that said nothing but “ask the product”. Generated from
one list, a new built-in product is a line here, its own impls, and its
binding. The leading $ is passed in so the generated dispatch! can have
metavariables of its own on stable Rust.