@@ -282,44 +282,9 @@ pub(crate) mod filters {
282
282
}
283
283
}
284
284
285
- /// Extension method for relations.
286
- pub trait RelationLeaper < Key : Ord , Val : Ord > {
285
+ impl < Key : Ord , Val : Ord > Relation < ( Key , Val ) > {
287
286
/// Extend with `Val` using the elements of the relation.
288
- fn extend_with < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> Key > (
289
- & ' leap self ,
290
- key_func : Func ,
291
- ) -> extend_with:: ExtendWith < ' leap , Key , Val , Tuple , Func >
292
- where
293
- Key : ' leap ,
294
- Val : ' leap ;
295
- /// Extend with `Val` using the complement of the relation.
296
- fn extend_anti < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> Key > (
297
- & ' leap self ,
298
- key_func : Func ,
299
- ) -> extend_anti:: ExtendAnti < ' leap , Key , Val , Tuple , Func >
300
- where
301
- Key : ' leap ,
302
- Val : ' leap ;
303
- /// Extend with any value if tuple is present in relation.
304
- fn filter_with < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> ( Key , Val ) > (
305
- & ' leap self ,
306
- key_func : Func ,
307
- ) -> filter_with:: FilterWith < ' leap , Key , Val , Tuple , Func >
308
- where
309
- Key : ' leap ,
310
- Val : ' leap ;
311
- /// Extend with any value if tuple is absent from relation.
312
- fn filter_anti < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> ( Key , Val ) > (
313
- & ' leap self ,
314
- key_func : Func ,
315
- ) -> filter_anti:: FilterAnti < ' leap , Key , Val , Tuple , Func >
316
- where
317
- Key : ' leap ,
318
- Val : ' leap ;
319
- }
320
-
321
- impl < Key : Ord , Val : Ord > RelationLeaper < Key , Val > for Relation < ( Key , Val ) > {
322
- fn extend_with < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> Key > (
287
+ pub fn extend_with < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> Key > (
323
288
& ' leap self ,
324
289
key_func : Func ,
325
290
) -> extend_with:: ExtendWith < ' leap , Key , Val , Tuple , Func >
@@ -329,7 +294,9 @@ impl<Key: Ord, Val: Ord> RelationLeaper<Key, Val> for Relation<(Key, Val)> {
329
294
{
330
295
extend_with:: ExtendWith :: from ( self , key_func)
331
296
}
332
- fn extend_anti < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> Key > (
297
+
298
+ /// Extend with `Val` using the complement of the relation.
299
+ pub fn extend_anti < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> Key > (
333
300
& ' leap self ,
334
301
key_func : Func ,
335
302
) -> extend_anti:: ExtendAnti < ' leap , Key , Val , Tuple , Func >
@@ -339,7 +306,9 @@ impl<Key: Ord, Val: Ord> RelationLeaper<Key, Val> for Relation<(Key, Val)> {
339
306
{
340
307
extend_anti:: ExtendAnti :: from ( self , key_func)
341
308
}
342
- fn filter_with < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> ( Key , Val ) > (
309
+
310
+ /// Extend with any value if tuple is present in relation.
311
+ pub fn filter_with < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> ( Key , Val ) > (
343
312
& ' leap self ,
344
313
key_func : Func ,
345
314
) -> filter_with:: FilterWith < ' leap , Key , Val , Tuple , Func >
@@ -349,7 +318,9 @@ impl<Key: Ord, Val: Ord> RelationLeaper<Key, Val> for Relation<(Key, Val)> {
349
318
{
350
319
filter_with:: FilterWith :: from ( self , key_func)
351
320
}
352
- fn filter_anti < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> ( Key , Val ) > (
321
+
322
+ /// Extend with any value if tuple is absent from relation.
323
+ pub fn filter_anti < ' leap , Tuple : Ord , Func : Fn ( & Tuple ) -> ( Key , Val ) > (
353
324
& ' leap self ,
354
325
key_func : Func ,
355
326
) -> filter_anti:: FilterAnti < ' leap , Key , Val , Tuple , Func >
0 commit comments