Trait oxc_index::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: Idx> IdxRangeBounds<I> for Range<I>

source§

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

source§

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

source§

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

source§

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

source§

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

Implementors§