Trait tor_basic_utils::rangebounds::RangeBoundsExt

source ·
pub trait RangeBoundsExt<T>: RangeBounds<T> {
    // Required method
    fn intersect<'a, U: RangeBounds<T>>(
        &'a self,
        other: &'a U
    ) -> Option<(Bound<&'a T>, Bound<&'a T>)>;
}
Expand description

An extension trait for RangeBounds.

Required Methods§

source

fn intersect<'a, U: RangeBounds<T>>( &'a self, other: &'a U ) -> Option<(Bound<&'a T>, Bound<&'a T>)>

Compute the intersection of two RangeBounds.

In essence, this computes the intersection of the intervals described by bounds of the two objects.

Returns None if the intersection of the two ranges is the empty set.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T, R> RangeBoundsExt<T> for R
where R: RangeBounds<T>, T: Ord,