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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use crate*;
/// An ordered, non-overlapping stream of intervals queried by position.
///
/// Implementors expose a single pull-based method, [`head`](Self::head), that
/// returns the next interval whose right endpoint is strictly greater than
/// `pos`. Iteration is layered on top by repeatedly calling `head` with the
/// previous interval's right endpoint converted to a left position via
/// [`RightT::into_left`].
///
/// `head` is **random-access**: callers may pass any `pos`, not just a
/// monotonically increasing sequence. Implementations should be prepared to
/// jump (see `IntervalsFromArray`'s binary-search implementation).
///
/// # Composition
///
/// `Intervals` values compose through combinators:
///
/// - intersection via [`and`](crate::and) / `&`
/// - union via [`or`](crate::or) / `|`
/// - value transforms via [`InIntervalsMap::map`](crate::InIntervalsMap::map)
/// - endpoint transforms via [`InIntervalsMapEndpoints::map_endpoints`](crate::InIntervalsMapEndpoints::map_endpoints),
/// [`IntervalShift`](crate::IntervalShift), [`IntervalStretch`](crate::IntervalStretch)
/// - memoization via [`IntervalsCache`](crate::IntervalsCache)
/// A passthrough wrapper used as the result type of the [`and`](crate::and)
/// and [`or`](crate::or) free functions.
///
/// Its sole purpose is to give a single named type that the `BitAnd` / `BitOr`
/// operator overloads can be implemented on, avoiding Rust's coherence
/// limitations on blanket impls.