Crate intervals_general

Source
Expand description

This crate enables generalized Interval representation and operations

Supporting generic bound data types (e.g. compatible with units-of-measure to enable typechecked physical units) - and supporting all necessary Interval representations for closure of interval operations. See README.md for detailed design discussion.

§Examples

use intervals_general::bound_pair::BoundPair;
use intervals_general::interval::Interval;
let bounds = BoundPair::new(1.0, 2.0).ok_or("invalid BoundPair")?;
let right_half_open = Interval::RightHalfOpen { bound_pair: bounds }; // [1.0, 2.0)

§Requirements

§Support For

  1. Intervals with bound data types provied via generic
  2. Open, closed and half-open Intervals
  3. Type-enforced representation of the empty Interval
  4. Type-enforced representation of unbounded Intervals
§Implementation Constraints
  1. no_std support
  2. No use of of panic, assert
  3. Minimize error handling by design
  4. Make the library hard to use incorrectly

Re-exports§

Modules§