pub trait MultiwaySortedDisjointMap<T, V, VR, I>: IntoIterator<Item = I> + Sized{
// Provided methods
fn union(self) -> BitOrMapKMerge<T, V, VR, I> { ... }
fn intersection<'a>(self) -> BitAndMapWithRangeValues<'a, T, V, VR, I> { ... }
fn symmetric_difference(self) -> BitXorMapKMerge<T, V, VR, I> { ... }
}Expand description
The trait used to define methods on multiple SortedDisjointMap iterators,
specifically union and intersection.
Provided Methods§
sourcefn union(self) -> BitOrMapKMerge<T, V, VR, I>
fn union(self) -> BitOrMapKMerge<T, V, VR, I>
Unions the given SortedDisjointMap iterators, creating a new SortedDisjointMap iterator.
The input iterators must be of the same type. Any number of input iterators can be given.
For input iterators of different types, use the [union_dyn] macro.
§Performance
All work is done on demand, in one pass through the input iterators. Minimal memory is used.
§Example
Find the integers that appear in any of the SortedDisjointMap iterators.
use range_set_blaze::prelude::*;
let a = RangeMapBlaze::from_iter([1..=6, 8..=9, 11..=15]).into_ranges();
let b = RangeMapBlaze::from_iter([5..=13, 18..=29]).into_ranges();
let c = RangeMapBlaze::from_iter([25..=100]).into_ranges();
let union = [a, b, c].union();
assert_eq!(union.into_string(), "1..=15, 18..=100");sourcefn intersection<'a>(self) -> BitAndMapWithRangeValues<'a, T, V, VR, I>
fn intersection<'a>(self) -> BitAndMapWithRangeValues<'a, T, V, VR, I>
Intersects the given SortedDisjointMap iterators, creating a new SortedDisjointMap iterator.
The input iterators must be of the same type. Any number of input iterators can be given.
For input iterators of different types, use the [intersection_dyn] macro.
§Performance
All work is done on demand, in one pass through the input iterators. Minimal memory is used.
§Example
Find the integers that appear in all the SortedDisjointMap iterators.
use range_set_blaze::prelude::*;
let a = RangeMapBlaze::from_iter([1..=6, 8..=9, 11..=15]).into_ranges();
let b = RangeMapBlaze::from_iter([5..=13, 18..=29]).into_ranges();
let c = RangeMapBlaze::from_iter([-100..=100]).into_ranges();
let intersection = [a, b, c].intersection();
assert_eq!(intersection.into_string(), "5..=6, 8..=9, 11..=13");sourcefn symmetric_difference(self) -> BitXorMapKMerge<T, V, VR, I>
fn symmetric_difference(self) -> BitXorMapKMerge<T, V, VR, I>
Symmetric difference on the given SortedDisjointMap iterators, creating a new SortedDisjointMap iterator.