@@ -27,7 +27,7 @@ pub use crate::treefrog::{
27
27
filter_anti:: FilterAnti ,
28
28
filter_with:: FilterWith ,
29
29
filters:: { PrefixFilter , ValueFilter } ,
30
- Leaper , RelationLeaper ,
30
+ Leaper , Leapers , RelationLeaper ,
31
31
} ;
32
32
33
33
/// A static, ordered list of key-value pairs.
@@ -116,9 +116,9 @@ impl<Tuple: Ord> Relation<Tuple> {
116
116
117
117
/// Creates a `Relation` using the `leapjoin` logic;
118
118
/// see [`Variable::leapjoin`]
119
- pub fn from_leapjoin < ' a , SourceTuple : Ord , Val : Ord + ' a > (
119
+ pub fn from_leapjoin < ' leap , SourceTuple : Ord , Val : Ord + ' leap > (
120
120
source : & Relation < SourceTuple > ,
121
- leapers : & mut [ & mut dyn Leaper < ' a , SourceTuple , Val > ] ,
121
+ leapers : impl Leapers < ' leap , SourceTuple , Val > ,
122
122
logic : impl FnMut ( & SourceTuple , & Val ) -> Tuple ,
123
123
) -> Self {
124
124
treefrog:: leapjoin ( & source. elements , leapers, logic)
@@ -409,8 +409,9 @@ impl<Tuple: Ord> Variable<Tuple> {
409
409
/// some dynamic variable `source` of source tuples (`SourceTuple`)
410
410
/// with some set of values (of type `Val`).
411
411
/// - You provide these values by combining `source` with a set of leapers
412
- /// `leapers`, each of which is derived from a fixed relation. You can create
413
- /// a leaper in one of two ways:
412
+ /// `leapers`, each of which is derived from a fixed relation. The `leapers`
413
+ /// should be either a single leaper (of suitable type) or else a tuple of leapers.
414
+ /// You can create a leaper in one of two ways:
414
415
/// - Extension: In this case, you have a relation of type `(K, Val)` for some
415
416
/// type `K`. You provide a closure that maps from `SourceTuple` to the key
416
417
/// `K`. If you use `relation.extend_with`, then any `Val` values the
@@ -423,10 +424,10 @@ impl<Tuple: Ord> Variable<Tuple> {
423
424
/// - Finally, you get a callback `logic` that accepts each `(SourceTuple, Val)`
424
425
/// that was successfully joined (and not filtered) and which maps to the
425
426
/// type of this variable.
426
- pub fn from_leapjoin < ' a , SourceTuple : Ord , Val : Ord + ' a > (
427
+ pub fn from_leapjoin < ' leap , SourceTuple : Ord , Val : Ord + ' leap > (
427
428
& self ,
428
429
source : & Variable < SourceTuple > ,
429
- leapers : & mut [ & mut dyn Leaper < ' a , SourceTuple , Val > ] ,
430
+ leapers : impl Leapers < ' leap , SourceTuple , Val > ,
430
431
logic : impl FnMut ( & SourceTuple , & Val ) -> Tuple ,
431
432
) {
432
433
self . insert ( treefrog:: leapjoin ( & source. recent . borrow ( ) , leapers, logic) ) ;
0 commit comments