[−][src]Enum range_set::range_compare::RangeDisjoint
Ways in which a pair of ranges (A,B) can be disjoint
Variants
EmptyBothA = B = {}
EmptyLhsA = {}
EmptyRhsB = {}
LessThanProper[ A ] [ B ]
LessThanAdjacent[ A ][ B ]
GreaterThanProper[ B ] [ A ]
GreaterThanAdjacent[ B ][ A ]
Methods
impl RangeDisjoint[src]
pub fn compare<T: PrimInt>(
left: &RangeInclusive<T>,
right: &RangeInclusive<T>
) -> Option<Self>[src]
left: &RangeInclusive<T>,
right: &RangeInclusive<T>
) -> Option<Self>
Tests two inclusive ranges for disjointness, returning None if they
intersect.
assert_eq!(RangeDisjoint::compare (&(0..=5), &(0..=5)), None); assert_eq!( RangeDisjoint::compare (&(1..=0), &(1..=0)), Some (RangeDisjoint::EmptyBoth)); assert_eq!( RangeDisjoint::compare (&(1..=0), &(0..=5)), Some (RangeDisjoint::EmptyLhs)); assert_eq!( RangeDisjoint::compare (&(0..=5), &(1..=0)), Some (RangeDisjoint::EmptyRhs)); assert_eq!( RangeDisjoint::compare (&(0..=2), &(4..=5)), Some (RangeDisjoint::LessThanProper)); assert_eq!( RangeDisjoint::compare (&(0..=2), &(3..=5)), Some (RangeDisjoint::LessThanAdjacent)); assert_eq!( RangeDisjoint::compare (&(4..=5), &(0..=2)), Some (RangeDisjoint::GreaterThanProper)); assert_eq!( RangeDisjoint::compare (&(3..=5), &(0..=2)), Some (RangeDisjoint::GreaterThanAdjacent));
Trait Implementations
impl Eq for RangeDisjoint[src]
impl PartialEq<RangeDisjoint> for RangeDisjoint[src]
fn eq(&self, other: &RangeDisjoint) -> bool[src]
#[must_use]
default fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
default fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl From<RangeDisjoint> for RangeCompare[src]
fn from(disjoint: RangeDisjoint) -> Self[src]
impl Debug for RangeDisjoint[src]
Auto Trait Implementations
impl Send for RangeDisjoint
impl Sync for RangeDisjoint
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> From for T[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,