@@ -27,7 +27,7 @@ pub use crate::treefrog::{
2727 filter_anti:: FilterAnti ,
2828 filter_with:: FilterWith ,
2929 filters:: { PrefixFilter , ValueFilter } ,
30- Leaper , RelationLeaper ,
30+ Leaper , Leapers , RelationLeaper ,
3131} ;
3232
3333/// A static, ordered list of key-value pairs.
@@ -116,9 +116,9 @@ impl<Tuple: Ord> Relation<Tuple> {
116116
117117 /// Creates a `Relation` using the `leapjoin` logic;
118118 /// 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 > (
120120 source : & Relation < SourceTuple > ,
121- leapers : & mut [ & mut dyn Leaper < ' a , SourceTuple , Val > ] ,
121+ leapers : impl Leapers < ' leap , SourceTuple , Val > ,
122122 logic : impl FnMut ( & SourceTuple , & Val ) -> Tuple ,
123123 ) -> Self {
124124 treefrog:: leapjoin ( & source. elements , leapers, logic)
@@ -409,8 +409,9 @@ impl<Tuple: Ord> Variable<Tuple> {
409409 /// some dynamic variable `source` of source tuples (`SourceTuple`)
410410 /// with some set of values (of type `Val`).
411411 /// - 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:
414415 /// - Extension: In this case, you have a relation of type `(K, Val)` for some
415416 /// type `K`. You provide a closure that maps from `SourceTuple` to the key
416417 /// `K`. If you use `relation.extend_with`, then any `Val` values the
@@ -423,10 +424,10 @@ impl<Tuple: Ord> Variable<Tuple> {
423424 /// - Finally, you get a callback `logic` that accepts each `(SourceTuple, Val)`
424425 /// that was successfully joined (and not filtered) and which maps to the
425426 /// 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 > (
427428 & self ,
428429 source : & Variable < SourceTuple > ,
429- leapers : & mut [ & mut dyn Leaper < ' a , SourceTuple , Val > ] ,
430+ leapers : impl Leapers < ' leap , SourceTuple , Val > ,
430431 logic : impl FnMut ( & SourceTuple , & Val ) -> Tuple ,
431432 ) {
432433 self . insert ( treefrog:: leapjoin ( & source. recent . borrow ( ) , leapers, logic) ) ;
0 commit comments