Expand description
Traits which describe basic concepts from order theory:
LeastElementandGreatestElementfor unique extremal values.LatticeandBoundedLattice, built up fromLowerSemilattice,UpperSemilatticeandBoundedLowerSemilattice,BoundedUpperSemilatticerespectively.TrySuccessor,SuccessorExceptForGreatestandSuccessorfor orders with unique successors for some, almost all, or all values respectively.TryPredecessor,PredecessorExceptForLeastandPredecessorfor orders with unique predecessors for some, almost all, or all values respectively.
Beyond those traits, the ranges module exposes functionality for treating ranges as lattices (where the greatest_lower_bound of two ranges is their intersection, and the least_upper_bound is the smallest range containing all items contained in either of them).
Finally, the [property_checks] module (available when the dev feature is enabled) provides utilities for property testing for all the traits of this crate (and the traits in core::cmp).
Modules§
- finite_
range - Functionality for treating ranges as lattices.
Traits§
- Bounded
Lattice - A bounded lattice is a type which is both a
BoundedLowerSemilatticeand aBoundedUpperSemilattice. Every bounded lattice is also a regular lattice. - Bounded
Lower Semilattice - A
LowerSemilatticewith a least element. - Bounded
Upper Semilattice - An
UpperSemilatticewith a greatest element. - Greatest
Element - A partial order with a greatest element (which is necessarily unique).
- Lattice
- A lattice is a type which is both a
LowerSemilatticeand anUpperSemilattice. - Least
Element - A partial order with a least element (which is necessarily unique).
- Lower
Semilattice - A partial order in which for any two elements there exists a unique greatest lower bound.
- Predecessor
- A partial order where every element has a unique predecessor.
- Predecessor
Except ForLeast - A partial order where every element but the least element has a unique predecessor.
- Successor
- A partial order where every element has a unique successor.
- Successor
Except ForGreatest - A partial order where every element but the greatest element has a unique successor.
- TryPredecessor
- A partial order in which some elements have predecessors, i.e., unique greatest lesser values.
- TrySuccessor
- A partial order in which some elements have successors, i.e., unique least greater values.
- Upper
Semilattice - A partial order in which for any two elements there exists a unique least upper bound.