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
//! Markers that say how an [`Instant`](crate::Instant)'s timeline is read.
/// The set of timelines an [`Instant`](crate::Instant) can be on.
///
/// Sealed: the kinds are [`Monotonic`] and [`Wrapping`].
/// Marker for an instant on a timeline that does not wrap.
///
/// Total order, so [`Ord`]. Arithmetic is plain `+` and `-`, panicking on overflow in debug and
/// wrapping in release. Nothing checks that the timeline really does not wrap, so use
/// [`Wrapping`] for raw hardware counters.
/// Marker for an instant on a circular counter, such as a hardware timer.
///
/// Arithmetic wraps, and comparison reads `self - other` as a signed offset, so it is only
/// meaningful within half the tick range and not transitive, which is less than [`PartialOrd`]
/// and [`Ord`] promise, so neither is implemented. Comparison goes through
/// [`InstantOrd`](crate::InstantOrd) or the inherent `is_before`/`is_after`/`const_partial_cmp`:
///
/// ```compile_fail
/// use fugit::WrappingInstant;
///
/// fn assert_partial_ord<T: PartialOrd>() {}
/// assert_partial_ord::<WrappingInstant<u32, 1, 1_000>>();
/// ```