Trait range_collections::range_set::AbstractRangeSet [−][src]
pub trait AbstractRangeSet<T: RangeSetEntry> {
Show 13 methods
fn boundaries(&self) -> &[T];
fn to_range_set<A: Array<Item = T>>(&self) -> RangeSet<A>
where
T: Clone,
{ ... }
fn contains(&self, value: &T) -> bool { ... }
fn is_empty(&self) -> bool { ... }
fn is_all(&self) -> bool { ... }
fn is_disjoint(&self, that: &impl AbstractRangeSet<T>) -> bool { ... }
fn is_subset(&self, that: impl AbstractRangeSet<T>) -> bool { ... }
fn is_superset(&self, that: impl AbstractRangeSet<T>) -> bool { ... }
fn iter(&self) -> Iter<'_, T>ⓘ { ... }
fn intersection<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A>
where
A: Array<Item = T>,
T: Clone,
{ ... }
fn union<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A>
where
A: Array<Item = T>,
T: Clone,
{ ... }
fn difference<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A>
where
A: Array<Item = T>,
T: Clone,
{ ... }
fn symmetric_difference<A>(
&self,
that: &impl AbstractRangeSet<T>
) -> RangeSet<A>
where
A: Array<Item = T>,
T: Clone,
{ ... }
}Expand description
Anything that provides sorted boundaries
This is just implemented for ArchivedRangeSet and RangeSet. It probably does not make sense to implement it yourself.
Required methods
fn boundaries(&self) -> &[T]
fn boundaries(&self) -> &[T]
the boundaries as a reference - must be strictly sorted
Provided methods
fn to_range_set<A: Array<Item = T>>(&self) -> RangeSet<A> where
T: Clone,
fn to_range_set<A: Array<Item = T>>(&self) -> RangeSet<A> where
T: Clone,
convert to a normal range set
fn is_disjoint(&self, that: &impl AbstractRangeSet<T>) -> bool
fn is_disjoint(&self, that: &impl AbstractRangeSet<T>) -> bool
true if this range set is disjoint from another range set
fn is_subset(&self, that: impl AbstractRangeSet<T>) -> bool
fn is_subset(&self, that: impl AbstractRangeSet<T>) -> bool
true if this range set is a superset of another range set
A range set is considered to be a superset of itself
fn is_superset(&self, that: impl AbstractRangeSet<T>) -> bool
fn is_superset(&self, that: impl AbstractRangeSet<T>) -> bool
true if this range set is a subset of another range set
A range set is considered to be a subset of itself
iterate over all ranges in this range set
fn intersection<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A> where
A: Array<Item = T>,
T: Clone,
fn intersection<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A> where
A: Array<Item = T>,
T: Clone,
intersection
union
fn difference<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A> where
A: Array<Item = T>,
T: Clone,
fn difference<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A> where
A: Array<Item = T>,
T: Clone,
difference
fn symmetric_difference<A>(
&self,
that: &impl AbstractRangeSet<T>
) -> RangeSet<A> where
A: Array<Item = T>,
T: Clone,
fn symmetric_difference<A>(
&self,
that: &impl AbstractRangeSet<T>
) -> RangeSet<A> where
A: Array<Item = T>,
T: Clone,
symmetric difference (xor)