use super::IsSingleFieldPath;
use crate::field::FieldBit;
mod sealed {
pub trait Sealed {}
}
use self::sealed::Sealed;
pub trait ArrayPath: IsSingleFieldPath + Sealed {
const INDEX: usize;
const DROP_BIT: FieldBit = FieldBit::new(Self::INDEX as u8);
}
pub unsafe trait IsPathForArray<Array>: ArrayPath {}
macro_rules! impl_is_path_for_array {
(
$( $path:ident[$index:expr; $($i:expr,)* ] )*
) => (
crate::tstr_aliases!{
$( $path = $index ,)*
}
$(
impl Sealed for $path{}
impl ArrayPath for $path{
const INDEX:usize=$index;
}
$(
unsafe impl<T> IsPathForArray<[T;$i]> for $path{}
)*
)*
);
}
impl_is_path_for_array! {
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,]
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,]
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,]
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,]
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,]
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,]
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,]
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,]
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,]
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,]
I10[10;11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
I11[11;12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
I12[12;13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
I13[13;14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
I14[14;15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
I15[15;16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
I16[16;17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
I17[17;18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
I18[18;19,20,21,22,23,24,25,26,27,28,29,30,31,32,]
I19[19;20,21,22,23,24,25,26,27,28,29,30,31,32,]
I20[20;21,22,23,24,25,26,27,28,29,30,31,32,]
I21[21;22,23,24,25,26,27,28,29,30,31,32,]
I22[22;23,24,25,26,27,28,29,30,31,32,]
I23[23;24,25,26,27,28,29,30,31,32,]
I24[24;25,26,27,28,29,30,31,32,]
I25[25;26,27,28,29,30,31,32,]
I26[26;27,28,29,30,31,32,]
I27[27;28,29,30,31,32,]
I28[28;29,30,31,32,]
I29[29;30,31,32,]
I30[30;31,32,]
I31[31;32,]
}