Trait poplar_util::ranges::RangeIntersect

source ·
pub trait RangeIntersect: Sized {
    // Required methods
    fn encompasses(&self, other: Self) -> bool;
    fn intersects(&self, other: Self) -> bool;
    fn intersection(&self, other: Self) -> Option<Self>;
    fn split(&self, other: Self) -> (Option<Self>, Option<Self>, Option<Self>);
}

Required Methods§

source

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

Returns true if all values in other are within self.

source

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

source

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

source

fn split(&self, other: Self) -> (Option<Self>, Option<Self>, Option<Self>)

Split self into three ranges: the portion before other, the intersection, and the portion after other.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> RangeIntersect for Range<T>
where T: Clone + Copy + Ord,

source§

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

source§

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

source§

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

source§

fn split(&self, other: Self) -> (Option<Self>, Option<Self>, Option<Self>)

Implementors§