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
//! Integer types for the dispatcher's internal point and entry handles.
use Debug;
use Hash;
/// Seals [`Index`] so that only the integer types below implement it.
/// Unsigned integer type a [`Dispatcher`](super::Dispatcher) stores point and entry handles
/// in: `u16`, `u32` or `usize` (the default).
///
/// Public handles stay [`TimePoint`](crate::TimePoint)`(usize)`; the index type only sets the
/// width of the dispatcher's internal arrays (adjacency targets, range offsets, precedence
/// counters, activation links). A network fits iff its point count and its entry count
/// (`2 * edges + waits`) are both at most the type's maximum value, so that every index and
/// every range offset, including the one-past-the-end offset, is representable. Loading a
/// network that does not fit fails with
/// [`DispatchError::IndexTypeTooSmall`](super::DispatchError::IndexTypeTooSmall). Choosing
/// capacities `N, E <= MAX` rules that out statically.
///
/// # Memory
///
/// Measured `size_of` per point and per entry capacity slot:
///
/// | Target | `usize` | `u32` | `u16` |
/// | --- | --- | --- | --- |
/// | `thumbv7em-none-eabihf` (32-bit) | 80 + 16 | 80 + 16 | 76 + 16 |
/// | `x86_64` | 96 + 24 | 80 + 16 | 76 + 16 |
///
/// Entries and windows hold `i64` ticks and are 8-byte aligned, so on 32-bit targets a narrow
/// index saves only the per-point offsets and counters.
///
/// The trait is sealed: it cannot be implemented outside this crate.
/// Implements [`Index`] for unsigned integer types.
impl_index!;