int_interval_set/int_co_set.rs
1#[cfg(test)]
2mod test_support;
3
4use std::sync::Arc;
5
6use int_interval::traits::IntCO;
7
8/// Immutable canonical closed-open integer interval set.
9///
10/// Internally this is an `Arc<[I]>`, so cloning an `IntCOSet<I>` is cheap.
11///
12/// Canonical invariant:
13///
14/// ```text
15/// for every adjacent pair a, b:
16/// a.end_excl() < b.start()
17/// ```
18///
19/// The strict `<` means both overlap and adjacency have already been merged.
20///
21/// `I::Ord` is expected to follow interval boundary ordering, consistent with
22/// the primitive interval implementations provided by `int_interval`.
23#[repr(transparent)]
24#[derive(Clone, Debug, Eq, PartialEq)]
25pub struct IntCOSet<I: IntCO> {
26 intervals: Arc<[I]>,
27}
28
29mod impls_for_accessors;
30mod impls_for_algebra;
31mod impls_for_construction;
32mod impls_for_find_out_coverage;
33mod impls_for_predicates;
34mod impls_for_searching;
35
36mod funcs_for_canonicalization;