pub struct Interval<T> {
pub lo: T,
pub hi: T,
}Available on crate feature
interval-tree only.Expand description
A closed interval [lo, hi] used as a key in IntervalTree.
Intervals are ordered by their lower endpoint (lo). Two intervals with the
same lo are further ordered by their upper endpoint (hi).
Fields§
§lo: TInclusive lower bound.
hi: TInclusive upper bound.
Implementations§
Source§impl<T: Ord> Interval<T>
impl<T: Ord> Interval<T>
Sourcepub fn overlaps(&self, other: &Self) -> bool
pub fn overlaps(&self, other: &Self) -> bool
Returns true if this interval overlaps with other.
Two intervals overlap if they share at least one point:
[a, b] overlaps [c, d] iff a <= d && c <= b.
Sourcepub fn contains_point(&self, point: &T) -> bool
pub fn contains_point(&self, point: &T) -> bool
Returns true if this interval contains point.
Trait Implementations§
Source§impl<T: Ord + Clone + Default, V> Augment<Interval<T>, V> for MaxHi<T>
impl<T: Ord + Clone + Default, V> Augment<Interval<T>, V> for MaxHi<T>
impl<T: Copy> Copy for Interval<T>
impl<T: Eq> Eq for Interval<T>
Source§impl<T: Ord, KBound, V> InOrderPruningPolicy<Interval<T>, V, T> for IntervalOverlapPolicy<T, KBound>where
KBound: Borrow<T>,
impl<T: Ord, KBound, V> InOrderPruningPolicy<Interval<T>, V, T> for IntervalOverlapPolicy<T, KBound>where
KBound: Borrow<T>,
Source§fn is_match(&self, key: &Interval<T>, _value: &V, _stats: &T) -> bool
fn is_match(&self, key: &Interval<T>, _value: &V, _stats: &T) -> bool
Evaluates if the current node satisfies the lookup constraints.
Source§impl<T: Ord> Ord for Interval<T>
impl<T: Ord> Ord for Interval<T>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: Ord> PartialOrd for Interval<T>
impl<T: Ord> PartialOrd for Interval<T>
impl<T: PartialEq> StructuralPartialEq for Interval<T>
Auto Trait Implementations§
impl<T> Freeze for Interval<T>where
T: Freeze,
impl<T> RefUnwindSafe for Interval<T>where
T: RefUnwindSafe,
impl<T> Send for Interval<T>where
T: Send,
impl<T> Sync for Interval<T>where
T: Sync,
impl<T> Unpin for Interval<T>where
T: Unpin,
impl<T> UnsafeUnpin for Interval<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Interval<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more