[−][src]Struct rangemap::RangeSet
A set whose items are stored as ranges.
See RangeMap
's documentation for more details.
Implementations
impl<T> RangeSet<T> where
T: Ord + Clone,
[src]
T: Ord + Clone,
pub fn new() -> Self
[src]
Makes a new empty RangeSet
.
pub fn get(&self, value: &T) -> Option<&Range<T>>
[src]
Returns a reference to the range covering the given key, if any.
pub fn contains(&self, value: &T) -> bool
[src]
Returns true
if any range in the set covers the specified value.
pub fn iter(&self) -> impl Iterator<Item = &Range<T>>
[src]
Gets an ordered iterator over all ranges, ordered by range.
pub fn insert(&mut self, range: Range<T>)
[src]
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
.
pub fn remove(&mut self, range: Range<T>)
[src]
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
.
Trait Implementations
impl<T: Clone> Clone for RangeSet<T>
[src]
impl<T> Default for RangeSet<T> where
T: Ord + Clone,
[src]
T: Ord + Clone,
Auto Trait Implementations
impl<T> RefUnwindSafe for RangeSet<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for RangeSet<T> where
T: Send,
T: Send,
impl<T> Sync for RangeSet<T> where
T: Sync,
T: Sync,
impl<T> Unpin for RangeSet<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for RangeSet<T> where
T: RefUnwindSafe + UnwindSafe,
T: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,