1use crate::arity::{self, A0, A1, A2, A3, A4, A5, A6};
2#[cfg(feature = "max-arity-12")]
3use crate::arity::{A7, A8, A9, A10, A11, A12};
4
5cfg_tt::cfg_tt! {
6pub trait Tuple
8 #[cfg(nightly_build)]
9 (: core::marker::Tuple) {
10 type Arity: arity::Arity;
17
18 #[doc(hidden)]
19 type BaseFn: crate::FnPtr<Args = Self>;
21}
22}
23
24macro_rules! impl_tuple {
26 (0, $arity:ty) => {
28 impl Tuple for () {
29 type Arity = $arity;
30 type BaseFn = fn();
31 }
32 };
33
34 ($n:tt, $arity:ty, ( $($T:ident),+ )) => {
36 impl< $($T),+ > Tuple for ( $($T,)+ ) {
37 type Arity = $arity;
38 type BaseFn = fn($($T,)+);
39 }
40 };
41}
42
43impl_tuple!(0, A0);
44impl_tuple!(1, A1, (T1));
45impl_tuple!(2, A2, (T1, T2));
46impl_tuple!(3, A3, (T1, T2, T3));
47impl_tuple!(4, A4, (T1, T2, T3, T4));
48impl_tuple!(5, A5, (T1, T2, T3, T4, T5));
49impl_tuple!(6, A6, (T1, T2, T3, T4, T5, T6));
50#[cfg(feature = "max-arity-12")]
51impl_tuple!(7, A7, (T1, T2, T3, T4, T5, T6, T7));
52#[cfg(feature = "max-arity-12")]
53impl_tuple!(8, A8, (T1, T2, T3, T4, T5, T6, T7, T8));
54#[cfg(feature = "max-arity-12")]
55impl_tuple!(9, A9, (T1, T2, T3, T4, T5, T6, T7, T8, T9));
56#[cfg(feature = "max-arity-12")]
57impl_tuple!(10, A10, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10));
58#[cfg(feature = "max-arity-12")]
59impl_tuple!(11, A11, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11));
60#[cfg(feature = "max-arity-12")]
61impl_tuple!(12, A12, (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12));