@@ -143,16 +143,26 @@ mod extend_with {
143
143
use join:: gallop;
144
144
145
145
/// Wraps a Relation<Tuple> as a leaper.
146
- pub struct ExtendWith < ' a , Key : Ord + ' a , Val : Ord + ' a , Tuple : Ord , Func : Fn ( & Tuple ) -> Key > {
146
+ pub struct ExtendWith < ' a , Key , Val , Tuple , Func >
147
+ where
148
+ Key : Ord + ' a ,
149
+ Val : Ord + ' a ,
150
+ Tuple : Ord ,
151
+ Func : Fn ( & Tuple ) -> Key ,
152
+ {
147
153
relation : & ' a Relation < ( Key , Val ) > ,
148
154
start : usize ,
149
155
end : usize ,
150
156
key_func : Func ,
151
157
phantom : :: std:: marker:: PhantomData < Tuple > ,
152
158
}
153
159
154
- impl < ' a , Key : Ord + ' a , Val : Ord + ' a , Tuple : Ord , Func : Fn ( & Tuple ) -> Key >
155
- ExtendWith < ' a , Key , Val , Tuple , Func >
160
+ impl < ' a , Key , Val , Tuple , Func > ExtendWith < ' a , Key , Val , Tuple , Func >
161
+ where
162
+ Key : Ord + ' a ,
163
+ Val : Ord + ' a ,
164
+ Tuple : Ord ,
165
+ Func : Fn ( & Tuple ) -> Key ,
156
166
{
157
167
/// Constructs a ExtendWith from a relation and key and value function.
158
168
pub fn from ( relation : & ' a Relation < ( Key , Val ) > , key_func : Func ) -> Self {
@@ -166,8 +176,12 @@ mod extend_with {
166
176
}
167
177
}
168
178
169
- impl < ' a , Key : Ord , Val : Ord + ' a , Tuple : Ord , Func : Fn ( & Tuple ) -> Key > Leaper < ' a , Tuple , Val >
170
- for ExtendWith < ' a , Key , Val , Tuple , Func >
179
+ impl < ' a , Key , Val , Tuple , Func > Leaper < ' a , Tuple , Val > for ExtendWith < ' a , Key , Val , Tuple , Func >
180
+ where
181
+ Key : Ord + ' a ,
182
+ Val : Ord + ' a ,
183
+ Tuple : Ord ,
184
+ Func : Fn ( & Tuple ) -> Key ,
171
185
{
172
186
fn count ( & mut self , prefix : & Tuple ) -> usize {
173
187
let key = ( self . key_func ) ( prefix) ;
@@ -196,14 +210,24 @@ mod extend_anti {
196
210
use join:: gallop;
197
211
198
212
/// Wraps a Relation<Tuple> as a leaper.
199
- pub struct ExtendAnti < ' a , Key : Ord + ' a , Val : Ord + ' a , Tuple : Ord , Func : Fn ( & Tuple ) -> Key > {
213
+ pub struct ExtendAnti < ' a , Key , Val , Tuple , Func >
214
+ where
215
+ Key : Ord + ' a ,
216
+ Val : Ord + ' a ,
217
+ Tuple : Ord ,
218
+ Func : Fn ( & Tuple ) -> Key ,
219
+ {
200
220
relation : & ' a Relation < ( Key , Val ) > ,
201
221
key_func : Func ,
202
222
phantom : :: std:: marker:: PhantomData < Tuple > ,
203
223
}
204
224
205
- impl < ' a , Key : Ord + ' a , Val : Ord + ' a , Tuple : Ord , Func : Fn ( & Tuple ) -> Key >
206
- ExtendAnti < ' a , Key , Val , Tuple , Func >
225
+ impl < ' a , Key , Val , Tuple , Func > ExtendAnti < ' a , Key , Val , Tuple , Func >
226
+ where
227
+ Key : Ord + ' a ,
228
+ Val : Ord + ' a ,
229
+ Tuple : Ord ,
230
+ Func : Fn ( & Tuple ) -> Key ,
207
231
{
208
232
/// Constructs a ExtendAnti from a relation and key and value function.
209
233
pub fn from ( relation : & ' a Relation < ( Key , Val ) > , key_func : Func ) -> Self {
@@ -217,6 +241,11 @@ mod extend_anti {
217
241
218
242
impl < ' a , Key : Ord , Val : Ord + ' a , Tuple : Ord , Func : Fn ( & Tuple ) -> Key > Leaper < ' a , Tuple , Val >
219
243
for ExtendAnti < ' a , Key , Val , Tuple , Func >
244
+ where
245
+ Key : Ord + ' a ,
246
+ Val : Ord + ' a ,
247
+ Tuple : Ord ,
248
+ Func : Fn ( & Tuple ) -> Key ,
220
249
{
221
250
fn count ( & mut self , _prefix : & Tuple ) -> usize {
222
251
usize:: max_value ( )
@@ -245,20 +274,24 @@ mod filter_with {
245
274
use super :: { Leaper , Relation } ;
246
275
247
276
/// Wraps a Relation<Tuple> as a leaper.
248
- pub struct FilterWith <
249
- ' a ,
277
+ pub struct FilterWith < ' a , Key , Val , Tuple , Func >
278
+ where
250
279
Key : Ord + ' a ,
251
280
Val : Ord + ' a ,
252
281
Tuple : Ord ,
253
282
Func : Fn ( & Tuple ) -> ( Key , Val ) ,
254
- > {
283
+ {
255
284
relation : & ' a Relation < ( Key , Val ) > ,
256
285
key_func : Func ,
257
286
phantom : :: std:: marker:: PhantomData < Tuple > ,
258
287
}
259
288
260
- impl < ' a , Key : Ord + ' a , Val : Ord + ' a , Tuple : Ord , Func : Fn ( & Tuple ) -> ( Key , Val ) >
261
- FilterWith < ' a , Key , Val , Tuple , Func >
289
+ impl < ' a , Key , Val , Tuple , Func > FilterWith < ' a , Key , Val , Tuple , Func >
290
+ where
291
+ Key : Ord + ' a ,
292
+ Val : Ord + ' a ,
293
+ Tuple : Ord ,
294
+ Func : Fn ( & Tuple ) -> ( Key , Val ) ,
262
295
{
263
296
/// Constructs a FilterWith from a relation and key and value function.
264
297
pub fn from ( relation : & ' a Relation < ( Key , Val ) > , key_func : Func ) -> Self {
@@ -270,8 +303,13 @@ mod filter_with {
270
303
}
271
304
}
272
305
273
- impl < ' a , Key : Ord , Val : Ord + ' a , Val2 , Tuple : Ord , Func : Fn ( & Tuple ) -> ( Key , Val ) >
274
- Leaper < ' a , Tuple , Val2 > for FilterWith < ' a , Key , Val , Tuple , Func >
306
+ impl < ' a , Key , Val , Val2 , Tuple , Func > Leaper < ' a , Tuple , Val2 >
307
+ for FilterWith < ' a , Key , Val , Tuple , Func >
308
+ where
309
+ Key : Ord + ' a ,
310
+ Val : Ord + ' a ,
311
+ Tuple : Ord ,
312
+ Func : Fn ( & Tuple ) -> ( Key , Val ) ,
275
313
{
276
314
fn count ( & mut self , prefix : & Tuple ) -> usize {
277
315
let key_val = ( self . key_func ) ( prefix) ;
@@ -295,20 +333,24 @@ mod filter_anti {
295
333
use super :: { Leaper , Relation } ;
296
334
297
335
/// Wraps a Relation<Tuple> as a leaper.
298
- pub struct FilterAnti <
299
- ' a ,
336
+ pub struct FilterAnti < ' a , Key , Val , Tuple , Func >
337
+ where
300
338
Key : Ord + ' a ,
301
339
Val : Ord + ' a ,
302
340
Tuple : Ord ,
303
341
Func : Fn ( & Tuple ) -> ( Key , Val ) ,
304
- > {
342
+ {
305
343
relation : & ' a Relation < ( Key , Val ) > ,
306
344
key_func : Func ,
307
345
phantom : :: std:: marker:: PhantomData < Tuple > ,
308
346
}
309
347
310
- impl < ' a , Key : Ord + ' a , Val : Ord + ' a , Tuple : Ord , Func : Fn ( & Tuple ) -> ( Key , Val ) >
311
- FilterAnti < ' a , Key , Val , Tuple , Func >
348
+ impl < ' a , Key , Val , Tuple , Func > FilterAnti < ' a , Key , Val , Tuple , Func >
349
+ where
350
+ Key : Ord + ' a ,
351
+ Val : Ord + ' a ,
352
+ Tuple : Ord ,
353
+ Func : Fn ( & Tuple ) -> ( Key , Val ) ,
312
354
{
313
355
/// Constructs a FilterAnti from a relation and key and value function.
314
356
pub fn from ( relation : & ' a Relation < ( Key , Val ) > , key_func : Func ) -> Self {
@@ -322,6 +364,11 @@ mod filter_anti {
322
364
323
365
impl < ' a , Key : Ord , Val : Ord + ' a , Val2 , Tuple : Ord , Func : Fn ( & Tuple ) -> ( Key , Val ) >
324
366
Leaper < ' a , Tuple , Val2 > for FilterAnti < ' a , Key , Val , Tuple , Func >
367
+ where
368
+ Key : Ord + ' a ,
369
+ Val : Ord + ' a ,
370
+ Tuple : Ord ,
371
+ Func : Fn ( & Tuple ) -> ( Key , Val ) ,
325
372
{
326
373
fn count ( & mut self , prefix : & Tuple ) -> usize {
327
374
let key_val = ( self . key_func ) ( prefix) ;
0 commit comments