intervals_general/
lib.rs

1//! This crate enables generalized Interval representation and operations
2//!
3//! Supporting generic bound data types (e.g. compatible with units-of-measure
4//! to enable typechecked physical units) - and supporting all necessary
5//! Interval representations for closure of interval operations.  See README.md
6//! for detailed design discussion.
7//!
8//! ## Examples
9//!
10//! ```
11//! use intervals_general::bound_pair::BoundPair;
12//! use intervals_general::interval::Interval;
13//! # fn main() -> std::result::Result<(), String> {
14//! let bounds = BoundPair::new(1.0, 2.0).ok_or("invalid BoundPair")?;
15//! let right_half_open = Interval::RightHalfOpen { bound_pair: bounds }; // [1.0, 2.0)
16//! # Ok(())
17//! # }
18//! ```
19//!
20//! ## Requirements
21//!
22//! ### Support For
23//!
24//! 1. Intervals with bound data types provied via generic
25//! 1. [Open](https://proofwiki.org/wiki/Definition:Real_Interval_Types#Open_Interval), [closed](https://proofwiki.org/wiki/Definition:Real_Interval_Types#Closed_Interval) and [half-open](https://proofwiki.org/wiki/Definition:Real_Interval/Half-Open) Intervals
26//! 1. Type-enforced representation of the [empty](https://proofwiki.org/wiki/Definition:Real_Interval/Empty) Interval
27//! 1. Type-enforced representation of [unbounded](https://proofwiki.org/wiki/Definition:Real_Interval_Types#Unbounded_Intervals) Intervals
28//!
29//! #### Implementation Constraints
30//!
31//! 1. no_std support
32//! 1. No use of of panic, assert
33//! 1. Minimize error handling by design
34//! 1. Make the library hard to use incorrectly
35
36pub mod bound_pair;
37pub mod interval;
38
39pub use interval::Interval;