Struct CopyRangeInclusive

Source
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) -> bool
where 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) -> bool
where 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.

Source

pub fn len(&self) -> usize

Returns the exact length of the range.

Trait Implementations§

Source§

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

Source§

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

Returns a duplicate 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]

Source§

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 String

Source§

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>

Source§

type Output = <Vec<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 str

Source§

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]

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 String

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>

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 str

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>,

Source§

type Item = Idx

The type of the elements being iterated over.
Source§

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 for CopyRangeInclusive<Idx>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

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) -> bool
where T: PartialOrd<U>, U: PartialOrd<T> + ?Sized,

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

fn is_empty(&self) -> bool
where T: PartialOrd,

🔬This is a nightly-only experimental API. (range_bounds_is_empty)
Returns true if the range contains no items. One-sided ranges (RangeFrom, etc) always return false. 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) -> bool
where T: PartialOrd<U>, U: PartialOrd<T> + ?Sized,

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

fn is_empty(&self) -> bool
where T: PartialOrd,

🔬This is a nightly-only experimental API. (range_bounds_is_empty)
Returns true if the range contains no items. One-sided ranges (RangeFrom, etc) always return false. Read more
Source§

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

Source§

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

Source§

impl<Idx> StructuralPartialEq for CopyRangeInclusive<Idx>

Auto Trait Implementations§

§

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

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.