Struct range_map::RangeSet [] [src]

pub struct RangeSet<T> {
    // some fields omitted
}

A set of integers, implemented as a sorted list of (inclusive) ranges.

Methods

impl<T: Debug + PrimInt> RangeSet<T>
[src]

fn new() -> RangeSet<T>

Creates a new empty RangeSet.

fn is_empty(&self) -> bool

Tests if this set is empty.

fn is_full(&self) -> bool

Tests whether this set contains every valid value of T.

fn num_ranges(&self) -> usize

Returns the number of ranges used to represent this set.

fn num_elements(&self) -> usize

Returns the number of elements in the set.

This saturates at usize::MAX.

fn ranges<'a>(&'a self) -> RangeIter<'a, T>

Returns an iterator over all ranges in this set.

fn elements<'a>(&'a self) -> EltIter<'a, T>

Returns an iterator over all elements in this set.

fn contains(&self, val: T) -> bool

Checks if this set contains a value.

fn union(&self, other: &RangeSet<T>) -> RangeSet<T>

Returns the union between self and other.

fn full() -> RangeSet<T>

Creates a set that contains every value of T.

fn single(x: T) -> RangeSet<T>

Creates a set containing a single element.

fn except<I: Iterator<Item=T>>(it: I) -> RangeSet<T>

Creates a set containing all elements except the given ones.

Panics

  • if chars is not sorted or not unique.

fn intersection(&self, other: &RangeSet<T>) -> RangeSet<T>

Finds the intersection between this set and other.

fn negated(&self) -> RangeSet<T>

Returns the set of all characters that are not in this set.

Trait Implementations

impl<T: Debug + PrimInt> Debug for RangeSet<T>
[src]

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

Formats the value using the given formatter.

impl<T: Debug + PrimInt> FromIterator<Range<T>> for RangeSet<T>
[src]

fn from_iter<I: IntoIterator<Item=Range<T>>>(iter: I) -> Self

Builds a RangeSet from an iterator over Ranges.

Derived Implementations

impl<T: PartialEq> PartialEq for RangeSet<T>
[src]

fn eq(&self, __arg_0: &RangeSet<T>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &RangeSet<T>) -> bool

This method tests for !=.

impl<T: Hash> Hash for RangeSet<T>
[src]

fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl<T: Eq> Eq for RangeSet<T>
[src]

impl<T: Clone> Clone for RangeSet<T>
[src]

fn clone(&self) -> RangeSet<T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more