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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#![no_std]
pub mod u128;
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits1<N>(pub N);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits2<N>(pub N);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits4<N>(pub N);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits8<N>(pub N);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits16<N>(pub N);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits32<N>(pub N);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits64<N>(pub N);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits128<N>(pub N);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits1x2<N>(pub Bits2<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits2x4<N>(pub Bits4<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits3x4<N>(pub Bits4<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits4x8<N>(pub Bits8<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits5x8<N>(pub Bits8<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits8x16<N>(pub Bits16<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits9x16<N>(pub Bits16<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits16x32<N>(pub Bits32<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits17x32<N>(pub Bits32<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits32x64<N>(pub Bits64<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits33x64<N>(pub Bits64<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits64x128<N>(pub Bits128<N>);
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Bits65x128<N>(pub Bits128<N>);
impl<N> From<Bits1x2<N>> for Bits2<N> {
fn from(n: Bits1x2<N>) -> Self {
n.0
}
}
impl<N> From<Bits2x4<N>> for Bits4<N> {
fn from(n: Bits2x4<N>) -> Self {
n.0
}
}
impl<N> From<Bits3x4<N>> for Bits4<N> {
fn from(n: Bits3x4<N>) -> Self {
n.0
}
}
impl<N> From<Bits4x8<N>> for Bits8<N> {
fn from(n: Bits4x8<N>) -> Self {
n.0
}
}
impl<N> From<Bits5x8<N>> for Bits8<N> {
fn from(n: Bits5x8<N>) -> Self {
n.0
}
}
impl<N> From<Bits8x16<N>> for Bits16<N> {
fn from(n: Bits8x16<N>) -> Self {
n.0
}
}
impl<N> From<Bits9x16<N>> for Bits16<N> {
fn from(n: Bits9x16<N>) -> Self {
n.0
}
}
impl<N> From<Bits16x32<N>> for Bits32<N> {
fn from(n: Bits16x32<N>) -> Self {
n.0
}
}
impl<N> From<Bits17x32<N>> for Bits32<N> {
fn from(n: Bits17x32<N>) -> Self {
n.0
}
}
impl<N> From<Bits32x64<N>> for Bits64<N> {
fn from(n: Bits32x64<N>) -> Self {
n.0
}
}
impl<N> From<Bits33x64<N>> for Bits64<N> {
fn from(n: Bits33x64<N>) -> Self {
n.0
}
}
impl<N> From<Bits64x128<N>> for Bits128<N> {
fn from(n: Bits64x128<N>) -> Self {
n.0
}
}
impl<N> From<Bits65x128<N>> for Bits128<N> {
fn from(n: Bits65x128<N>) -> Self {
n.0
}
}