1use super::IsSingleFieldPath;
5
6use crate::field::FieldBit;
7
8mod sealed {
9 pub trait Sealed {}
10}
11use self::sealed::Sealed;
12
13pub trait ArrayPath: IsSingleFieldPath + Sealed {
15 const INDEX: usize;
17
18 const DROP_BIT: FieldBit = FieldBit::new(Self::INDEX as u8);
20}
21
22pub unsafe trait IsPathForArray<Array>: ArrayPath {}
29
30macro_rules! impl_is_path_for_array {
31 (
32 $( $path:ident[$index:expr; $($i:expr,)* ] )*
33 ) => (
34 crate::tstr_aliases!{
35 $( $path = $index ,)*
36 }
37 $(
38 impl Sealed for $path{}
39
40 impl ArrayPath for $path{
41 const INDEX:usize=$index;
42 }
43 $(
44 unsafe impl<T> IsPathForArray<[T;$i]> for $path{}
45 )*
46 )*
47 );
48}
49
50impl_is_path_for_array! {
63 I0[0;1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
64 I1[1;2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
65 I2[2;3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
66 I3[3;4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
67 I4[4;5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
68 I5[5;6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
69 I6[6;7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
70 I7[7;8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
71 I8[8;9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
72 I9[9;10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
73 I10[10;11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
74 I11[11;12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
75 I12[12;13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
76 I13[13;14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
77 I14[14;15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
78 I15[15;16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
79 I16[16;17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
80 I17[17;18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
81 I18[18;19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
82 I19[19;20,21,22,23,24,25,26,27,28,29,30,31,32,]
83 I20[20;21,22,23,24,25,26,27,28,29,30,31,32,]
84 I21[21;22,23,24,25,26,27,28,29,30,31,32,]
85 I22[22;23,24,25,26,27,28,29,30,31,32,]
86 I23[23;24,25,26,27,28,29,30,31,32,]
87 I24[24;25,26,27,28,29,30,31,32,]
88 I25[25;26,27,28,29,30,31,32,]
89 I26[26;27,28,29,30,31,32,]
90 I27[27;28,29,30,31,32,]
91 I28[28;29,30,31,32,]
92 I29[29;30,31,32,]
93 I30[30;31,32,]
94 I31[31;32,]
95}