RangeExt

Trait RangeExt 

Source
pub trait RangeExt<T> {
    // Required methods
    fn sorted(&self) -> Self;
    fn to_inclusive(&self) -> RangeInclusive<T>;
    fn overlaps(&self, other: &Range<T>) -> bool;
    fn contains_inclusive(&self, other: &Range<T>) -> bool;
}

Required Methods§

Source

fn sorted(&self) -> Self

Source

fn to_inclusive(&self) -> RangeInclusive<T>

Source

fn overlaps(&self, other: &Range<T>) -> bool

Source

fn contains_inclusive(&self, other: &Range<T>) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: Ord + Clone> RangeExt<T> for Range<T>

Source§

fn sorted(&self) -> Self

Source§

fn to_inclusive(&self) -> RangeInclusive<T>

Source§

fn overlaps(&self, other: &Range<T>) -> bool

Source§

fn contains_inclusive(&self, other: &Range<T>) -> bool

Source§

impl<T: Ord + Clone> RangeExt<T> for RangeInclusive<T>

Source§

fn sorted(&self) -> Self

Source§

fn to_inclusive(&self) -> RangeInclusive<T>

Source§

fn overlaps(&self, other: &Range<T>) -> bool

Source§

fn contains_inclusive(&self, other: &Range<T>) -> bool

Implementors§