Trait index_vec::IdxRangeBounds
source · pub trait IdxRangeBounds<I>: Sealedwhere
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.