sdmx_json/macros/
artefact.rs1macro_rules! impl_artefact {
2 ($($struct:ty),+ $(,)?) => {
3 $(
4 impl $crate::structure::Artefact for $struct {
5 fn artefact(&self) -> &crate::structure::CommonArtefactType {
6 &self.artefact
7 }
8
9 fn id(&self) -> &String {
10 &(self.artefact.id)
11 }
12
13 fn agency_id(&self) -> Option<&String> {
14 self.artefact.agency_id.as_ref()
15 }
16
17 fn version(&self) -> Option<&String> {
18 self.artefact.version.as_ref()
19 }
20
21 fn name(&self) -> Option<&String> {
22 self.artefact.name.as_ref()
23 }
24
25 fn names(&self) -> Option<&$crate::primitives::LocalizedText> {
26 self.artefact.names.as_ref()
27 }
28
29 fn valid_from(&self) -> Option<&String> {
30 self.artefact.valid_from.as_ref()
31 }
32
33 fn valid_to(&self) -> Option<&String> {
34 self.artefact.valid_to.as_ref()
35 }
36
37 fn is_external_reference(&self) -> Option<bool> {
38 self.artefact.is_external_reference
39 }
40
41 fn annotations(&self) -> Option<&Vec<$crate::primitives::Annotation>> {
42 self.artefact.annotations.as_ref()
43 }
44
45 fn links(&self) -> Option<&Vec<$crate::primitives::Link>> {
46 self.artefact.links.as_ref()
47 }
48 }
49 )+
50 };
51}