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

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

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
Expand description

The range we are splitting

borders: Vec<IntBorder>
Expand description

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]

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Debug for SplitIntRange[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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