classify

Function classify 

Source
pub fn classify<T, L, R>(a: L, b: R) -> Classify<L::IntoIter, R::IntoIter> 
where T: Ord, L: IntoIterator<Item = T>, R: IntoIterator<Item = T>,
Expand description

Interleave two sorted, deduplicated iterators in sorted order and classify each element according to its source.

§Examples

use iter_set::{classify, Inclusion};

let a = [1, 2];
let b = [2, 3];

assert!(classify(&a, &b).eq(vec![Inclusion::Left(&1), Inclusion::Both(&2, &2), Inclusion::Right(&3)]));