Struct range_inclusive::RangeInclusive
source · pub struct RangeInclusive<Idx: Clone + PartialOrd> { /* private fields */ }
Expand description
A range bounded inclusively below and above (start..=end
).
The RangeInclusive
start..=end
contains all values with x >= start
and x <= end
. It is empty unless start <= end
.
See the crate-level docs for more information.
Implementations§
source§impl<Idx: Clone + PartialOrd> RangeInclusive<Idx>
impl<Idx: Clone + PartialOrd> RangeInclusive<Idx>
sourcepub fn into_inner(self) -> (Idx, Idx)
pub fn into_inner(self) -> (Idx, Idx)
Destructures the RangeInclusive
into (lower bound, upper (inclusive) bound).
sourcepub fn iter(&self) -> RangeInclusiveIterator<Idx> ⓘ
pub fn iter(&self) -> RangeInclusiveIterator<Idx> ⓘ
Returns an iterator with the same start
and end
values as the range.
sourcepub fn contains<U>(&self, item: &U) -> boolwhere
Idx: PartialOrd<U>,
U: ?Sized + PartialOrd<Idx>,
pub fn contains<U>(&self, item: &U) -> boolwhere Idx: PartialOrd<U>, U: ?Sized + PartialOrd<Idx>,
Returns true
if item
is contained in the range.
Trait Implementations§
source§impl<Idx: Clone + Clone + PartialOrd> Clone for RangeInclusive<Idx>
impl<Idx: Clone + Clone + PartialOrd> Clone for RangeInclusive<Idx>
source§fn clone(&self) -> RangeInclusive<Idx>
fn clone(&self) -> RangeInclusive<Idx>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Idx: Clone + PartialOrd + Debug> Debug for RangeInclusive<Idx>
impl<Idx: Clone + PartialOrd + Debug> Debug for RangeInclusive<Idx>
source§impl<Idx: Hash + Clone + PartialOrd> Hash for RangeInclusive<Idx>
impl<Idx: Hash + Clone + PartialOrd> Hash for RangeInclusive<Idx>
source§impl<'a, Idx: Clone + PartialOrd + Step> IntoIterator for &'a RangeInclusive<Idx>
impl<'a, Idx: Clone + PartialOrd + Step> IntoIterator for &'a RangeInclusive<Idx>
source§impl<Idx: PartialEq + Clone + PartialOrd> PartialEq<RangeInclusive<Idx>> for RangeInclusive<Idx>
impl<Idx: PartialEq + Clone + PartialOrd> PartialEq<RangeInclusive<Idx>> for RangeInclusive<Idx>
source§fn eq(&self, other: &RangeInclusive<Idx>) -> bool
fn eq(&self, other: &RangeInclusive<Idx>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: Clone + PartialOrd> RangeBounds<T> for RangeInclusive<T>
impl<T: Clone + PartialOrd> RangeBounds<T> for RangeInclusive<T>
impl<Idx: Copy + Clone + PartialOrd> Copy for RangeInclusive<Idx>
impl<Idx: Eq + Clone + PartialOrd> Eq for RangeInclusive<Idx>
impl<Idx: Clone + PartialOrd> StructuralEq for RangeInclusive<Idx>
impl<Idx: Clone + PartialOrd> StructuralPartialEq for RangeInclusive<Idx>
Auto Trait Implementations§
impl<Idx> RefUnwindSafe for RangeInclusive<Idx>where Idx: RefUnwindSafe,
impl<Idx> Send for RangeInclusive<Idx>where Idx: Send,
impl<Idx> Sync for RangeInclusive<Idx>where Idx: Sync,
impl<Idx> Unpin for RangeInclusive<Idx>where Idx: Unpin,
impl<Idx> UnwindSafe for RangeInclusive<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