Macro code_product::product_items
source · product_items!() { /* proc-macro */ }Expand description
Macro doing product expansions per item. This means that (on toplevel) automatic scopes are generated up and including to the first braced block or semicolon. Then these scopes become independently expanded.
§Example
Define structures, the first two with &str members and remaining two a single i32
field and use them:
product_items! {
struct $((Foo)(Bar)) {
s: &'static str
}
struct $((Baz)(Barf)) (i32);
}
let _a = Foo { s: "one" };
let _b = Bar { s: "two" };
let _c = Baz(3);
let _c = Barf(4);