Macro tuplez::tuple_t

source ·
tuple_t!() { /* proc-macro */ }
Expand description

Generate the complete type signature for tuples.

§Syntax

tuple_t!([T0 [; Count], T1 [; Count], ... ])

The [ and ] markers only indicate optional content but not that the [ and ] need to be input.

Similarly, ... indicates several repeated segments, rather than inputing ....

§Examples

use tuplez::*;

let tup = <tuple_t!(i32, f64, String)>::default();
assert_eq!(tup, tuple!(0, 0.0, String::new()));

let unit: tuple_t!() = From::from(());
assert_eq!(unit, tuple!());

let tup2: tuple_t!(i32, f64;3, i32) = tuple!(1, 2.0, 3.0, 4.0, 5);

fn use_tuple(tup: tuple_t!(i32, &dyn std::fmt::Debug, tuple_t!(String, String))) {
    todo!()
}