1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! # Lazy interval-set composition
//!
//! `odsek` provides allocation-free, pull-based composition of ordered,
//! non-overlapping mathematical interval sets. Each [`Interval`] carries a
//! value, so intersections and unions can also be read as joins over tagged
//! segments.
//!
//! The core API is `no_std` and does not allocate. Streams are queried through
//! [`Intervals::head`], which returns the next interval after a requested
//! position; iteration and combinators are layered on top of that primitive.
//!
//! ## Endpoint flavors
//!
//! * [`EndpointOC`] supports explicitly open or closed boundaries.
//! * [`EndpointSymmetric`] represents the common `[a, b)` convention: closed
//! on the left, open on the right.
//!
//! ## Composition
//!
//! With the default `operators` feature, `&` computes intersection and `|`
//! computes union. Disable default features to use the explicit [`and`] and
//! [`or`] functions instead.
//!
//! ## Examples
//!
//! ```
//! use odsek::*;
//!
//! let ia = Interval::new(EndpointOC::Closed(1), EndpointOC::Closed(3), "A");
//! let ib = Interval::new(EndpointOC::Open(2), EndpointOC::Open(4), "B");
//!
//! let isa = IntervalsSingle::new(ia);
//! let isb = IntervalsSingle::new(ib);
//!
//! let and_ab = and(isa, isb);
//! let and_ab_vec = and_ab.into_iter().collect::<Vec<_>>();
//!
//! assert_eq!(and_ab_vec.len(), 1);
//! assert_eq!(and_ab_vec[0], Interval::new(EndpointOC::Open(2), EndpointOC::Closed(3), ("A","B")));
//! ```
// no_std when not testing
pub use *;
pub use *;
pub
pub use *;
pub use *;