Function lib::join_it [−] [src]

pub fn join_it<I, J, K, KI, KJ, F>(i: I, j: J, ki: KI, kj: KJ, f: F) where I: IntoIterator, J: IntoIterator, I::Item: Copy, J::Item: Copy, KI: Fn(I::Item) -> K, KJ: Fn(J::Item) -> K, F: FnMut(I::Item, J::Item), K: Ord

Maps f over the join between i and j, based on the key extractors ki and kj.

use join_it::join_it;
let v = vec![33,44,55,66].into_iter().enumerate();
let w = vec![(0,'a'),(2,'c')];
join_it(v, w, |(k,_)| k, |(k,_)| k, |(k0,a),(k1,b)| {
    assert_eq!(k0, k1);
    println!("Join result: ({},{})", a, b);
});Run