Struct rustc_index::interval::IntervalSet
source · Expand description
Stores a set of intervals on the indices.
The elements in map
are sorted and non-adjacent, which means
the second value of the previous element is greater than the
first value of the following element.
Fields
map: SmallVec<[(u32, u32); 4]>
domain: usize
_data: PhantomData<I>
Implementations
sourceimpl<I: Idx> IntervalSet<I>
impl<I: Idx> IntervalSet<I>
pub fn new(domain: usize) -> IntervalSet<I>
pub fn clear(&mut self)
pub fn iter(&self) -> impl Iterator<Item = I> + '_where
I: Step,
sourcepub fn iter_intervals(&self) -> impl Iterator<Item = Range<I>> + '_where
I: Step,
pub fn iter_intervals(&self) -> impl Iterator<Item = Range<I>> + '_where
I: Step,
Iterates through intervals stored in the set, in order.
sourcepub fn insert(&mut self, point: I) -> bool
pub fn insert(&mut self, point: I) -> bool
Returns true if we increased the number of elements present.
sourcepub fn insert_range(&mut self, range: impl RangeBounds<I> + Clone) -> bool
pub fn insert_range(&mut self, range: impl RangeBounds<I> + Clone) -> bool
Returns true if we increased the number of elements present.
pub fn contains(&self, needle: I) -> bool
pub fn superset(&self, other: &IntervalSet<I>) -> boolwhere
I: Step,
pub fn is_empty(&self) -> bool
sourcepub fn last_set_in(&self, range: impl RangeBounds<I> + Clone) -> Option<I>
pub fn last_set_in(&self, range: impl RangeBounds<I> + Clone) -> Option<I>
Returns the maximum (last) element present in the set from range
.
pub fn insert_all(&mut self)
pub fn union(&mut self, other: &IntervalSet<I>) -> boolwhere
I: Step,
fn check_invariants(&self) -> bool
Trait Implementations
sourceimpl<I: Clone> Clone for IntervalSet<I>
impl<I: Clone> Clone for IntervalSet<I>
sourcefn clone(&self) -> IntervalSet<I>
fn clone(&self) -> IntervalSet<I>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations
impl<I> RefUnwindSafe for IntervalSet<I>where
I: RefUnwindSafe,
impl<I> Send for IntervalSet<I>where
I: Send,
impl<I> Sync for IntervalSet<I>where
I: Sync,
impl<I> Unpin for IntervalSet<I>where
I: Unpin,
impl<I> UnwindSafe for IntervalSet<I>where
I: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 48 bytes