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
use std::fmt;
/// A GAEB DA XML schema generation.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum GaebVersion {
/// Legacy GAEB DA XML 3.1 using the shared `200407` namespace.
V3_1,
/// GAEB DA XML 3.2.
V3_2,
/// GAEB DA XML 3.3, the current stable generation.
V3_3,
/// GAEB DA XML 3.4 as published in the official 2026-03 beta bundle.
V3_4Beta,
}
impl GaebVersion {
/// The stable generation new production documents should target.
pub const CURRENT: Self = Self::V3_3;
pub(crate) fn from_text(value: &str) -> Option<Self> {
match value.trim() {
"3.1" => Some(Self::V3_1),
"3.2" => Some(Self::V3_2),
"3.3" => Some(Self::V3_3),
"3.4" => Some(Self::V3_4Beta),
_ => None,
}
}
/// The generation string used in GAEB XML.
#[must_use]
pub const fn as_str(self) -> &'static str {
match self {
Self::V3_1 => "3.1",
Self::V3_2 => "3.2",
Self::V3_3 => "3.3",
Self::V3_4Beta => "3.4",
}
}
/// Whether this generation is currently published only as beta material.
#[must_use]
pub const fn is_beta(self) -> bool {
matches!(self, Self::V3_4Beta)
}
}
impl fmt::Display for GaebVersion {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str(self.as_str())
}
}