pub enum RangeOverlap {
AContainsB,
AInsideB,
AEndsInB,
AStartsInB,
AEqualsB,
None,
}
Expand description
An enum describing the kind of overlap between two ranges.
Variants§
AContainsB
The second range is fully within the first, meaning that all values from the second are also in the first
AInsideB
The first range is fully within the second, meaning that all values from the first are also in the second
AEndsInB
The end of the first range overlaps with the start of the second. One case that depends on whether the ranges
are considered inclusive or exclusive is when the end of A equals the start of B. That case will only be AEndsInB
if the ranges are inclusive, otherwise it will be None
.
AStartsInB
The start of the first range overlaps the end of the second. One case that depends on whether the ranges
are considered inclusive or exclusive is when the start of A equals the end of B. That case will only be AStartsInB
if the ranges are inclusive, otherwise it will be None
.
AEqualsB
The bounds of both ranges are exactly the same.
None
There is no overlap between the two ranges.
Implementations§
Source§impl RangeOverlap
impl RangeOverlap
Sourcepub fn has_overlap(&self) -> bool
pub fn has_overlap(&self) -> bool
Returns true
if there was any overlap between the ranges
Trait Implementations§
Source§impl Clone for RangeOverlap
impl Clone for RangeOverlap
Source§fn clone(&self) -> RangeOverlap
fn clone(&self) -> RangeOverlap
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more