Macro tuplez::tuple_t

source ·
macro_rules! tuple_t {
    ($($t:tt)*) => { ... };
}
Expand description

Generate the complete type signature for tuples.

§Syntax

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

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

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

§Examples

use tuplez::{tuple, tuple_t};

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!()
}