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
// Tests routinely use `.unwrap()` for clarity; production code uses `?`.
//! Foundation enums for the obs SDK.
//!
//! Every other crate in the workspace depends on this one. The seven enums
//! defined here form the vocabulary of the wire envelope ([10-data-model.md
//! § 2-5](../../specs/10-data-model.md)) — `Tier`, `Severity`, `FieldKind`,
//! `Cardinality`, `Classification`, `MetricKind`, `SamplingReason`.
//!
//! All enums:
//! - derive `Copy + Clone + Debug + PartialEq + Eq + Hash`,
//! - implement [`buffa::Enumeration`] so they live on the wire,
//! - serialize/deserialize via `serde` for `obs.yaml` config,
//! - expose `const fn` helpers used by compile-time lints (e.g.
//! [`Cardinality::is_label_compatible`], [`Cardinality::cap`], [`Severity::as_str`]).
//!
//! Vocabulary changes here cause an envelope `format_ver` bump (per
//! [10-data-model.md § 6](../../specs/10-data-model.md#6-envelope) and
//! [61-crates-and-features.md § 4](../../specs/61-crates-and-features.md#4-versioning-policy)).
//! That's the intended forcing function.
pub use Cardinality;
pub use Classification;
pub use FieldKind;
pub use MetricKind;
pub use SamplingReason;
pub use Severity;
pub use Tier;
/// Error returned by `TryFrom<&str>` and `FromStr` parsers when an unknown
/// enum name is encountered. Each enum in this crate uses this type to
/// preserve a uniform error surface across the vocabulary.