Struct rustc_mir_build::thir::pattern::deconstruct_pat::SplitIntRange[−][src]

struct SplitIntRange {
    range: IntRange,
    borders: Vec<IntBorder>,
}

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: IntRange

The 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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone, 
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.