Struct rustc_mir_build::thir::pattern::deconstruct_pat::SplitIntRange [−][src]
A range of integers that is partitioned into disjoint subranges. This does constructor splitting for integer ranges as explained at the top of the file.
This is fed multiple ranges, and returns an output that covers the input, but is split so that the only intersections between an output range and a seen range are inclusions. No output range straddles the boundary of one of the inputs.
The following input:
|-------------------------| // `self` |------| |----------| |----| |-------| |-------|
would be iterated over as follows:
||---|--||-|---|---|---|--|
Fields
range: IntRangeThe range we are splitting
borders: Vec<IntBorder>The borders of ranges we have seen. They are all contained within range. This is kept
sorted.
Implementations
impl SplitIntRange[src]
fn new(range: IntRange) -> Self[src]
fn to_borders(r: IntRange) -> [IntBorder; 2][src]
Internal use
fn split(&mut self, ranges: impl Iterator<Item = IntRange>)[src]
Add ranges relative to which we split.
fn iter<'a>(&'a self) -> impl Iterator<Item = IntRange> + Captures<'a>[src]
Iterate over the contained ranges.
Trait Implementations
impl Clone for SplitIntRange[src]
fn clone(&self) -> SplitIntRange[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for SplitIntRange[src]
Auto Trait Implementations
impl RefUnwindSafe for SplitIntRange
impl Send for SplitIntRange
impl Sync for SplitIntRange
impl Unpin for SplitIntRange
impl UnwindSafe for SplitIntRange
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,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
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.
pub fn to_owned(&self) -> T[src]
pub 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.
pub 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>,