Struct rangemap::RangeInclusiveSet [−][src]
pub struct RangeInclusiveSet<T, StepFnsT = T> { /* fields omitted */ }Expand description
A set whose items are stored as ranges bounded
inclusively below and above (start..=end).
See RangeInclusiveMap’s documentation for more details.
Implementations
Makes a new empty RangeInclusiveSet, specifying successor and
predecessor functions defined separately from T itself.
This is useful as a workaround for Rust’s “orphan rules”,
which prevent you from implementing StepLite for T if T
is a foreign type.
NOTE: This will likely be deprecated and then eventually removed once the standard library’s Step trait is stabilised, as most crates will then likely implement Step for their types where appropriate.
See this issue for details about that stabilization process.
Returns a reference to the range covering the given key, if any.
Returns true if any range in the set covers the specified value.
Gets an ordered iterator over all ranges, ordered by range.
Insert a range into the set.
If the inserted range either overlaps or is immediately adjacent any existing range, then the ranges will be coalesced into a single contiguous range.
Panics
Panics if range start > end.
Removes a range from the set, if all or any of it was present.
If the range to be removed partially overlaps any ranges in the set, then those ranges will be contracted to no longer cover the removed range.
Panics
Panics if range start > end.
Gets an iterator over all the maximally-sized ranges
contained in outer_range that are not covered by
any range stored in the set.
The iterator element type is RangeInclusive<T>.
NOTE: Calling gaps eagerly finds the first gap,
even if the iterator is never consumed.
Trait Implementations
Extends a collection with the contents of an iterator. Read more
extend_one)Extends a collection with exactly one element.
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
impl<T> FromIterator<RangeInclusive<T>> for RangeInclusiveSet<T> where
T: Ord + Clone + StepLite,
impl<T> FromIterator<RangeInclusive<T>> for RangeInclusiveSet<T> where
T: Ord + Clone + StepLite,
Creates a value from an iterator. Read more
Auto Trait Implementations
impl<T, StepFnsT> RefUnwindSafe for RangeInclusiveSet<T, StepFnsT> where
StepFnsT: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, StepFnsT> Send for RangeInclusiveSet<T, StepFnsT> where
StepFnsT: Send,
T: Send,
impl<T, StepFnsT> Sync for RangeInclusiveSet<T, StepFnsT> where
StepFnsT: Sync,
T: Sync,
impl<T, StepFnsT> Unpin for RangeInclusiveSet<T, StepFnsT> where
StepFnsT: Unpin,
impl<T, StepFnsT> UnwindSafe for RangeInclusiveSet<T, StepFnsT> where
StepFnsT: UnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more