pub struct CopyRangeInclusive<Idx> {
    pub start: Idx,
    pub end: Idx,
}
Expand description

A range bounded inclusively above and below. See core::ops::RangeInclusive.

Unlike RangeInclusive, this struct is Copy if Idx is Copy, and implements IntoIterator instead of Interator.

Fields§

§start: Idx§end: Idx

Implementations§

source§

impl<Idx> CopyRangeInclusive<Idx>

source

pub fn contains<U>(&self, item: &U) -> boolwhere Idx: PartialOrd<U>, U: ?Sized + PartialOrd<Idx>,

Returns true if item is contained in the range.

See RangeInclusive::contains.

source

pub fn is_empty(&self) -> boolwhere Idx: PartialOrd,

Returns true if the range contains no items.

See RangeInclusive::contains.

source

pub fn from_std(range: RangeInclusive<Idx>) -> Self

Convert a RangeInclusive into a CopyRangeInclusive.

Note: the value returned by this conversion is unspecified after the RangeInclusive has been iterated to exhaustion.

source

pub fn into_std(self) -> RangeInclusive<Idx>

Convert a CopyRangeInclusive into a RangeInclusive.

Trait Implementations§

source§

impl<Idx: Clone> Clone for CopyRangeInclusive<Idx>

source§

fn clone(&self) -> CopyRangeInclusive<Idx>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Idx: Debug> Debug for CopyRangeInclusive<Idx>

source§

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

Formats the value using the given formatter. Read more
source§

impl<Idx> From<CopyRangeInclusive<Idx>> for RangeInclusive<Idx>

Convert a CopyRangeInclusive into a RangeInclusive.

source§

fn from(value: CopyRangeInclusive<Idx>) -> Self

Converts to this type from the input type.
source§

impl<Idx> From<RangeInclusive<Idx>> for CopyRangeInclusive<Idx>

Convert a RangeInclusive into a CopyRangeInclusive.

Note: the value returned by this conversion is unspecified after the RangeInclusive has been iterated to exhaustion.

source§

fn from(range: RangeInclusive<Idx>) -> Self

Converts to this type from the input type.
source§

impl<Idx: Hash> Hash for CopyRangeInclusive<Idx>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T> Index<CopyRangeInclusive<usize>> for [T]where [T]: Index<RangeInclusive<usize>>,

§

type Output = <[T] as Index<RangeInclusive<usize>>>::Output

The returned type after indexing.
source§

fn index(&self, index: CopyRangeInclusive<usize>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl Index<CopyRangeInclusive<usize>> for Stringwhere String: Index<RangeInclusive<usize>>,

§

type Output = <String as Index<RangeInclusive<usize>>>::Output

The returned type after indexing.
source§

fn index(&self, index: CopyRangeInclusive<usize>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<T> Index<CopyRangeInclusive<usize>> for Vec<T>where Vec<T>: Index<RangeInclusive<usize>>,

§

type Output = <Vec<T, Global> as Index<RangeInclusive<usize>>>::Output

The returned type after indexing.
source§

fn index(&self, index: CopyRangeInclusive<usize>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl Index<CopyRangeInclusive<usize>> for strwhere str: Index<RangeInclusive<usize>>,

§

type Output = <str as Index<RangeInclusive<usize>>>::Output

The returned type after indexing.
source§

fn index(&self, index: CopyRangeInclusive<usize>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<T> IndexMut<CopyRangeInclusive<usize>> for [T]where [T]: IndexMut<RangeInclusive<usize>>,

source§

fn index_mut(&mut self, index: CopyRangeInclusive<usize>) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl IndexMut<CopyRangeInclusive<usize>> for Stringwhere String: IndexMut<RangeInclusive<usize>>,

source§

fn index_mut(&mut self, index: CopyRangeInclusive<usize>) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<T> IndexMut<CopyRangeInclusive<usize>> for Vec<T>where Vec<T>: IndexMut<RangeInclusive<usize>>,

source§

fn index_mut(&mut self, index: CopyRangeInclusive<usize>) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl IndexMut<CopyRangeInclusive<usize>> for strwhere str: IndexMut<RangeInclusive<usize>>,

source§

fn index_mut(&mut self, index: CopyRangeInclusive<usize>) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<Idx> IntoIterator for CopyRangeInclusive<Idx>where RangeInclusive<Idx>: Iterator<Item = Idx>,

§

type Item = Idx

The type of the elements being iterated over.
§

type IntoIter = RangeInclusive<Idx>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<Idx: PartialEq> PartialEq<CopyRangeInclusive<Idx>> for CopyRangeInclusive<Idx>

source§

fn eq(&self, other: &CopyRangeInclusive<Idx>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Idx> RangeBounds<Idx> for CopyRangeInclusive<&Idx>

source§

fn start_bound(&self) -> Bound<&Idx>

Start index bound. Read more
source§

fn end_bound(&self) -> Bound<&Idx>

End index bound. Read more
1.35.0 · source§

fn contains<U>(&self, item: &U) -> boolwhere T: PartialOrd<U>, U: PartialOrd<T> + ?Sized,

Returns true if item is contained in the range. Read more
source§

impl<Idx> RangeBounds<Idx> for CopyRangeInclusive<Idx>

source§

fn start_bound(&self) -> Bound<&Idx>

Start index bound. Read more
source§

fn end_bound(&self) -> Bound<&Idx>

End index bound. Read more
1.35.0 · source§

fn contains<U>(&self, item: &U) -> boolwhere T: PartialOrd<U>, U: PartialOrd<T> + ?Sized,

Returns true if item is contained in the range. Read more
source§

impl<Idx: Copy> Copy for CopyRangeInclusive<Idx>

source§

impl<Idx: Eq> Eq for CopyRangeInclusive<Idx>

source§

impl<Idx> StructuralEq for CopyRangeInclusive<Idx>

source§

impl<Idx> StructuralPartialEq for CopyRangeInclusive<Idx>

Auto Trait Implementations§

§

impl<Idx> RefUnwindSafe for CopyRangeInclusive<Idx>where Idx: RefUnwindSafe,

§

impl<Idx> Send for CopyRangeInclusive<Idx>where Idx: Send,

§

impl<Idx> Sync for CopyRangeInclusive<Idx>where Idx: Sync,

§

impl<Idx> Unpin for CopyRangeInclusive<Idx>where Idx: Unpin,

§

impl<Idx> UnwindSafe for CopyRangeInclusive<Idx>where Idx: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.