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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//! [`CurrencyState`] — whether an act is still law, and which text to cite.
use ;
/// Whether an act is still law, and which text carries it.
///
/// # Why this is not [`InstrumentStatus`](crate::instrument::InstrumentStatus)
///
/// That type is a **legislative-progress** axis: it answers *"does a text exist
/// that can be cited by CELEX?"*. This one answers *"is that text still the
/// law, and is it the version to cite?"*. The two are orthogonal in both
/// directions — a repealed act was still adopted, and an adopted act may have
/// been rewritten underneath its own CELEX number without anything in the file,
/// the filename or the number changing.
///
/// The second direction is the dangerous one, because the citation still
/// resolves. An act cited from a pre-amendment text really is law and its
/// article numbers really do exist; they simply no longer say what they said.
///
/// # Why the variants are named for the citer's question
///
/// [`Consolidated`](Self::Consolidated) deliberately does **not** distinguish an
/// amendment from a corrigendum, though the two are different legal events. It
/// is the state EUR-Lex expresses by generating a consolidated text, and the
/// consequence for anyone citing the act is identical either way: the published
/// text is no longer the one to quote.
///
/// The worked example is Regulation (EU) 2024/1781 itself. Its consolidation
/// carries the provenance line `02024R1781 -- EN -- 28.06.2024 -- 000.001` and
/// the heading *"Corrected by:"* — consolidation number `000`, meaning no
/// amendment has been folded in at all. It is a corrigendum, and it still moves
/// the text a reader must cite. A model that recorded only amendments would
/// call that act unchanged and send the reader to the superseded text.
///
/// # Not modelled: amended with no consolidation yet
///
/// EUR-Lex generates consolidated texts on a lag, so an act amended recently is
/// briefly changed with no consolidated CELEX to point at. No act in this
/// catalog is in that state, and a variant nothing produces is a distinction
/// every caller must handle and none can test. The state to add, if one ever
/// lands, is `Amended` with the amending act's own CELEX in place of a
/// consolidated one.
///
/// Serialised internally tagged on `state`:
/// `{"state":"inForce"}`,
/// `{"state":"consolidated","asOf":"02023R1542-20260813"}`,
/// `{"state":"repealed","by":"32026R0248","on":"2026-02-22"}`.
// `rename_all` renames the variants; `rename_all_fields` renames the fields
// inside them, and only the second reaches `as_of`. Without it the wire form
// silently becomes `as_of` while every neighbouring key is camelCase.