IdxRangeBounds

Trait IdxRangeBounds 

Source
pub trait IdxRangeBounds<I>: Sealed
where I: Idx,
{ type Range: RangeBounds<usize>; // Required method fn into_range(self) -> Self::Range; }
Expand description

This trait to function in API signatures where Vec<T> or [T] use R: RangeBounds<usize>. There are blanket implementations for the basic range types in core::ops for all Idx types. e.g. Range<I: Idx>, RangeFrom<I: Idx>, RangeTo<I: Idx>, etc all implement it.

IMO it’s unfortunate that this needs to be present in the API, but it doesn’t hurt that much.

Required Associated Types§

Required Methods§

Source

fn into_range(self) -> Self::Range

Implementations on Foreign Types§

Source§

impl<I> IdxRangeBounds<I> for Range<I>
where I: Idx,

Source§

impl<I> IdxRangeBounds<I> for RangeFrom<I>
where I: Idx,

Source§

impl<I> IdxRangeBounds<I> for RangeFull
where I: Idx,

Source§

impl<I> IdxRangeBounds<I> for RangeInclusive<I>
where I: Idx,

Source§

impl<I> IdxRangeBounds<I> for RangeTo<I>
where I: Idx,

Source§

impl<I> IdxRangeBounds<I> for RangeToInclusive<I>
where I: Idx,

Implementors§