Skip to main content

RangeExtensions

Trait RangeExtensions 

Source
pub trait RangeExtensions {
    // Required methods
    fn width(&self) -> usize;
    fn shift(&mut self, d: isize);
    fn contains(&self, other: &Self) -> bool;
    fn intersects(&self, other: &Self) -> bool;
    fn intersection(&self, other: &Self) -> Self;
    fn empty(&self) -> bool;
}

Required Methods§

Source

fn width(&self) -> usize

Source

fn shift(&mut self, d: isize)

Source

fn contains(&self, other: &Self) -> bool

Source

fn intersects(&self, other: &Self) -> bool

Source

fn intersection(&self, other: &Self) -> Self

Source

fn empty(&self) -> bool

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 RangeExtensions for Range<usize>

Source§

fn width(&self) -> usize

Source§

fn shift(&mut self, d: isize)

Source§

fn contains(&self, other: &Range<usize>) -> bool

Source§

fn intersects(&self, other: &Range<usize>) -> bool

Source§

fn intersection(&self, other: &Range<usize>) -> Range<usize>

Source§

fn empty(&self) -> bool

Implementors§