Trait range_collections::range_set::AbstractRangeSet [−][src]
pub trait AbstractRangeSet<T> {
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
where
T: Ord,
{ ... }
fn is_empty(&self) -> bool { ... }
fn is_all(&self) -> bool
where
T: RangeSetEntry,
{ ... }
fn is_disjoint(&self, that: &impl AbstractRangeSet<T>) -> bool
where
T: RangeSetEntry,
{ ... }
fn is_subset(&self, that: impl AbstractRangeSet<T>) -> bool
where
T: Ord,
{ ... }
fn is_superset(&self, that: impl AbstractRangeSet<T>) -> bool
where
T: Ord,
{ ... }
fn iter(&self) -> Iter<'_, T>ⓘ { ... }
fn intersection<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A>
where
A: Array<Item = T>,
T: Ord + Clone,
{ ... }
fn union<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A>
where
A: Array<Item = T>,
T: Ord + Clone,
{ ... }
fn difference<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A>
where
A: Array<Item = T>,
T: Ord + Clone,
{ ... }
fn symmetric_difference<A>(
&self,
that: &impl AbstractRangeSet<T>
) -> RangeSet<A>
where
A: Array<Item = T>,
T: Ord + 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
true if the value is contained in the range set
fn is_all(&self) -> bool where
T: RangeSetEntry,
fn is_all(&self) -> bool where
T: RangeSetEntry,
true if the range set contains all values
fn is_disjoint(&self, that: &impl AbstractRangeSet<T>) -> bool where
T: RangeSetEntry,
fn is_disjoint(&self, that: &impl AbstractRangeSet<T>) -> bool where
T: RangeSetEntry,
true if this range set is disjoint from another range set
fn is_subset(&self, that: impl AbstractRangeSet<T>) -> bool where
T: Ord,
fn is_subset(&self, that: impl AbstractRangeSet<T>) -> bool where
T: Ord,
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 where
T: Ord,
fn is_superset(&self, that: impl AbstractRangeSet<T>) -> bool where
T: Ord,
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: Ord + Clone,
fn intersection<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A> where
A: Array<Item = T>,
T: Ord + Clone,
intersection
union
fn difference<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A> where
A: Array<Item = T>,
T: Ord + Clone,
fn difference<A>(&self, that: &impl AbstractRangeSet<T>) -> RangeSet<A> where
A: Array<Item = T>,
T: Ord + Clone,
difference
fn symmetric_difference<A>(
&self,
that: &impl AbstractRangeSet<T>
) -> RangeSet<A> where
A: Array<Item = T>,
T: Ord + Clone,
fn symmetric_difference<A>(
&self,
that: &impl AbstractRangeSet<T>
) -> RangeSet<A> where
A: Array<Item = T>,
T: Ord + Clone,
symmetric difference (xor)