pub enum Range<Idx> {
Continuous(ContinuousRange<Idx>),
Composite(Vec<ContinuousRange<Idx>>),
}
Variants§
Continuous(ContinuousRange<Idx>)
Composite(Vec<ContinuousRange<Idx>>)
Implementations§
Source§impl<Idx: PartialOrd + Clone> Range<Idx>
impl<Idx: PartialOrd + Clone> Range<Idx>
Sourcepub fn continuous(start: Idx, end: Idx) -> Selfwhere
Idx: PartialOrd,
pub fn continuous(start: Idx, end: Idx) -> Selfwhere
Idx: PartialOrd,
A range between start
(inclusive) and end
(inclusive)
[start..end]
Sourcepub fn continuous_exclusive(start: Idx, end: Idx) -> Selfwhere
Idx: PartialOrd,
pub fn continuous_exclusive(start: Idx, end: Idx) -> Selfwhere
Idx: PartialOrd,
A range between start
(exclusive) and end
(exclusive)
(start..end)
Sourcepub fn continuous_start_exclusive(start: Idx, end: Idx) -> Range<Idx>where
Idx: PartialOrd,
pub fn continuous_start_exclusive(start: Idx, end: Idx) -> Range<Idx>where
Idx: PartialOrd,
A range between start
(exclusive) and end
(inclusive)
(start..end]
Sourcepub fn continuous_end_exclusive(start: Idx, end: Idx) -> Range<Idx>where
Idx: PartialOrd,
pub fn continuous_end_exclusive(start: Idx, end: Idx) -> Range<Idx>where
Idx: PartialOrd,
A range between start
(inclusive) and end
(exclusive)
[start..end)
Sourcepub fn from_exclusive(start: Idx) -> Self
pub fn from_exclusive(start: Idx) -> Self
A range starting from start
(exclusive)
(start..)
Sourcepub fn to_exclusive(end: Idx) -> Self
pub fn to_exclusive(end: Idx) -> Self
A range ending with end
(exclusive)
(..end)
pub fn composite(items: impl IntoIterator<Item = Range<Idx>>) -> Range<Idx>where
Idx: PartialOrd,
pub fn range_bounds(&self) -> Option<(Bound<&Idx>, Bound<&Idx>)>
pub fn contains(&self, value: impl Borrow<Idx>) -> boolwhere
Idx: PartialOrd,
pub fn union(&self, other: &Range<Idx>) -> Range<Idx>where
Idx: PartialOrd,
pub fn intersection(self, _other: &Range<Idx>) -> Range<Idx>
pub fn difference(self, _other: &Range<Idx>) -> Range<Idx>
pub fn overlaps(self, _other: &Range<Idx>) -> bool
Sourcepub fn compare_bounds(&self, _other: &Range<Idx>) -> RangesRelation
pub fn compare_bounds(&self, _other: &Range<Idx>) -> RangesRelation
Compare the bounds of two ranges
pub fn simplify_mut(&mut self)where
Idx: PartialOrd,
pub fn simplify(&self) -> Selfwhere
Idx: PartialOrd + Clone,
pub fn is_empty(&self) -> bool
pub fn is_full(&self) -> boolwhere
Idx: PartialOrd + Clone,
Trait Implementations§
Source§impl<Idx> From<ContinuousRange<Idx>> for Range<Idx>
impl<Idx> From<ContinuousRange<Idx>> for Range<Idx>
Source§fn from(r: ContinuousRange<Idx>) -> Self
fn from(r: ContinuousRange<Idx>) -> Self
Converts to this type from the input type.
Source§impl<Idx: PartialOrd + Clone> From<RangeInclusive<Idx>> for Range<Idx>
impl<Idx: PartialOrd + Clone> From<RangeInclusive<Idx>> for Range<Idx>
Source§fn from(r: RangeInclusive<Idx>) -> Self
fn from(r: RangeInclusive<Idx>) -> Self
Converts to this type from the input type.
Source§impl<Idx: PartialOrd + Clone> From<RangeToInclusive<Idx>> for Range<Idx>
impl<Idx: PartialOrd + Clone> From<RangeToInclusive<Idx>> for Range<Idx>
Source§fn from(r: RangeToInclusive<Idx>) -> Self
fn from(r: RangeToInclusive<Idx>) -> Self
Converts to this type from the input type.
impl<Idx> StructuralPartialEq for Range<Idx>
Auto Trait Implementations§
impl<Idx> Freeze for Range<Idx>where
Idx: Freeze,
impl<Idx> RefUnwindSafe for Range<Idx>where
Idx: RefUnwindSafe,
impl<Idx> Send for Range<Idx>where
Idx: Send,
impl<Idx> Sync for Range<Idx>where
Idx: Sync,
impl<Idx> Unpin for Range<Idx>where
Idx: Unpin,
impl<Idx> UnwindSafe for Range<Idx>where
Idx: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more