Macro Product

Source
Product!() { /* proc-macro */ }
Expand description

The Product! macro is used to define a type-level list of types, a.k.a. a product type.

Given a list of types to the macro, it would generate a chain of Cons types for each type in the list, and terminated with the Nil type.

Read more about product types in the documentation for Cons.

§Example

Given the following product type definition:

type MyTypes = Product![u32, String, bool];

The following type would be generated:

type MyTypes = Cons<u32, Cons<String, Cons<bool, Nil>>>;

which would be shown with the shortened representation as:

type MyTypes = π<u32, π<String, π<bool, ε>>>;