pub trait MultiwayRangeMapBlaze<'a, T: Integer + 'a, V: ValueOwned + 'a>: IntoIterator<Item = &'a RangeMapBlaze<T, V>> + Sized {
// Provided methods
fn union(self) -> RangeMapBlaze<T, V> { ... }
fn intersection(self) -> RangeMapBlaze<T, V> { ... }
fn symmetric_difference(self) -> RangeMapBlaze<T, V> { ... }
}Expand description
The trait used to provide methods on multiple RangeMapBlaze’s,
specifically union and intersection.
Also see [MultiwayRangeMapBlazeRef].
Provided Methods§
sourcefn union(self) -> RangeMapBlaze<T, V>
fn union(self) -> RangeMapBlaze<T, V>
Unions the given RangeMapBlaze’s, creating a new RangeMapBlaze.
Any number of input can be given.
For exactly two inputs, you can also use the ‘|’ operator.
Also see [MultiwayRangeMapBlazeRef::union].
§Performance
All work is done on demand, in one pass through the inputs. Minimal memory is used.
§Example
Find the integers that appear in any of the RangeMapBlaze’s.
use range_set_blaze::prelude::*;
let a = RangeMapBlaze::from_iter([1..=6, 8..=9, 11..=15]);
let b = RangeMapBlaze::from_iter([5..=13, 18..=29]);
let c = RangeMapBlaze::from_iter([25..=100]);
let union = [a, b, c].union();
assert_eq!(union, RangeMapBlaze::from_iter([1..=15, 18..=100]));sourcefn intersection(self) -> RangeMapBlaze<T, V>
fn intersection(self) -> RangeMapBlaze<T, V>
Intersects the given RangeMapBlaze’s, creating a new RangeMapBlaze.
Any number of input can be given.
For exactly two inputs, you can also use the ‘&’ operator.
Also see [MultiwayRangeMapBlazeRef::intersection].
The intersection of 0 maps is undefined. (We can create a universal set of integers, but we don’t know that value to use.)
§Performance
All work is done on demand, in one pass through the inputs. Minimal memory is used.
§Example
Find the integers that appear in all the RangeMapBlaze’s.
use range_set_blaze::prelude::*;
let a = RangeMapBlaze::from_iter([1..=6, 8..=9, 11..=15]);
let b = RangeMapBlaze::from_iter([5..=13, 18..=29]);
let c = RangeMapBlaze::from_iter([-100..=100]);
let intersection = [a, b, c].intersection();
assert_eq!(intersection, RangeMapBlaze::from_iter([5..=6, 8..=9, 11..=13]));sourcefn symmetric_difference(self) -> RangeMapBlaze<T, V>
fn symmetric_difference(self) -> RangeMapBlaze<T, V>
Symmetric difference on the given RangeMapBlaze’s, creating a new RangeMapBlaze.