sdmx_json/macros/
item_scheme.rs

1macro_rules! impl_item_scheme {
2	($(($struct: ty, $field: ident)),+ $(,)?) => {
3		$(
4			impl $crate::structure::ItemScheme for $struct {
5				fn is_partial(&self) -> Option<bool> {
6					self.is_partial
7				}
8
9				fn items(&self) -> Option<&Vec<$crate::structure::Item>> {
10					self.$field.as_ref()
11				}
12
13				fn set_items(&mut self, items: Option<Vec<$crate::structure::Item>>) {
14					self.$field = items;
15				}
16
17				fn clear_items(&mut self) {
18					self.$field = None;
19				}
20
21				fn contains_items(&self) -> bool {
22					match &self.$field {
23						Some(items) => !items.is_empty(),
24						None => false,
25					}
26				}
27			}
28		)+
29	};
30}