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
//! Stable labels of the enums that cross a process boundary or feed the metrics.
//!
//! A label is a **contract**, not a debug string: an observer keys its series on
//! it (`kind="complete"`, `role="resp"`, `state="dead"`), so renaming one
//! silently breaks a dashboard. Writing them in a table per enum, in the same
//! shape everywhere, is what makes them auditable together — and what makes a
//! second, drifting table visible if one ever appears.
/// Implements `label()` on an enum from a table of `variant => "text"` pairs.
///
/// The mapping itself cannot be derived: a stable label is a naming decision, so
/// it has to be written somewhere. What this macro removes is everything around
/// the decision — the `impl`, the signature, the `match` and the exhaustiveness
/// — so that declaring the labels of an enum is writing a table, and adding a
/// variant without a label does not compile.
pub use impl_labels;