std_traits/
tuple.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::primitive::Primitive;

pub trait Tuple: Primitive {
    const N: usize;
}
impl Primitive for () {}
impl Tuple for () {
    const N: usize = 0;
}
impl<T1: ?Sized> Primitive for (T1,) {}
impl<T1: ?Sized> Tuple for (T1,) {
    const N: usize = 1;
}
impl<T1, T2: ?Sized> Primitive for (T1, T2) {}
impl<T1, T2: ?Sized> Tuple for (T1, T2) {
    const N: usize = 2;
}