Skip to main content

RangeExt

Trait RangeExt 

Source
pub trait RangeExt
where Self::Idx: Copy, Self: Sized,
{ type Idx; // Required method fn mv(&self, l: Self::Idx, r: Self::Idx) -> Self; // Provided method fn shift(&self, a: Self::Idx) -> Self { ... } }
Expand description

Shift the endpoints of a Range or RangeInclusive by independent left/right offsets.

Required Associated Types§

Required Methods§

Source

fn mv(&self, l: Self::Idx, r: Self::Idx) -> Self

Provided Methods§

Source

fn shift(&self, a: Self::Idx) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Idx> RangeExt for Range<Idx>
where Idx: Copy + Add<Output = Idx> + Sub<Output = Idx> + Neg<Output = Idx>,

Source§

type Idx = Idx

Source§

fn mv(&self, l: Self::Idx, r: Self::Idx) -> Self

Source§

impl<Idx> RangeExt for RangeInclusive<Idx>
where Idx: Copy + Add<Output = Idx> + Sub<Output = Idx> + Neg<Output = Idx>,

Source§

type Idx = Idx

Source§

fn mv(&self, l: Self::Idx, r: Self::Idx) -> Self

Implementors§