Enum range_set::range_compare::RangeDisjoint[][src]

pub enum RangeDisjoint {
    EmptyBoth,
    EmptyLhs,
    EmptyRhs,
    LessThanProper,
    LessThanAdjacent,
    GreaterThanProper,
    GreaterThanAdjacent,
}
Expand description

Ways in which a pair of ranges (A,B) can be disjoint

Variants

EmptyBoth

A = B = {}

EmptyLhs

A = {}

EmptyRhs

B = {}

LessThanProper

[ A ] [ B ]

LessThanAdjacent

[ A ][ B ]

GreaterThanProper

[ B ] [ A ]

GreaterThanAdjacent

[ B ][ A ]

Implementations

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

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.