Trait 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.

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.

Implementors§

Source§

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