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
117
118
119
120
121
122
123
use litemap::LiteMap;
use std::borrow::Cow;
macro_rules! map_access {
($outer: ty => $inner: ty: $lt: lifetime) => {
impl<$lt> $outer {
pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<&$inner>
where
Q: Ord,
Cow<'s, str>: std::borrow::Borrow<Q>,
{
self.0.get(key)
}
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
}
impl<$lt, Q: ?Sized> std::ops::Index<&Q> for $outer
where
Q: Ord,
Cow<'s, str>: std::borrow::Borrow<Q>,
{
type Output = $inner;
fn index(&self, key: &Q) -> &Self::Output {
self.0.get(key).unwrap()
}
}
};
}
#[derive(PartialEq, Debug, Clone, Default)]
#[cfg_attr(
feature = "provider_serde",
derive(serde::Serialize, serde::Deserialize)
)]
pub struct TimeZoneFormatsV1<'s> {
pub hour_format: (Cow<'s, str>, Cow<'s, str>),
pub gmt_format: Cow<'s, str>,
pub gmt_zero_format: Cow<'s, str>,
pub region_format: Cow<'s, str>,
pub region_format_variants: LiteMap<Cow<'s, str>, Cow<'s, str>>,
pub fallback_format: Cow<'s, str>,
}
#[derive(PartialEq, Debug, Clone, Default)]
#[cfg_attr(
feature = "provider_serde",
derive(serde::Serialize, serde::Deserialize)
)]
pub struct ExemplarCitiesV1<'s>(pub LiteMap<Cow<'s, str>, Cow<'s, str>>);
map_access!(ExemplarCitiesV1<'s> => Cow<'s, str>: 's);
#[derive(PartialEq, Debug, Clone, Default)]
#[cfg_attr(
feature = "provider_serde",
derive(serde::Serialize, serde::Deserialize)
)]
pub struct MetaZoneGenericNamesLongV1<'s>(pub LiteMap<Cow<'s, str>, Cow<'s, str>>);
map_access!(MetaZoneGenericNamesLongV1<'s> => Cow<'s, str>: 's);
#[derive(PartialEq, Debug, Clone, Default)]
#[cfg_attr(
feature = "provider_serde",
derive(serde::Serialize, serde::Deserialize)
)]
pub struct MetaZoneGenericNamesShortV1<'s>(pub LiteMap<Cow<'s, str>, Cow<'s, str>>);
map_access!(MetaZoneGenericNamesShortV1<'s> => Cow<'s, str>: 's);
#[derive(PartialEq, Debug, Clone, Default)]
#[cfg_attr(
feature = "provider_serde",
derive(serde::Serialize, serde::Deserialize)
)]
pub struct MetaZoneSpecificNamesLongV1<'s>(pub LiteMap<Cow<'s, str>, MetaZoneSpecificNamesV1<'s>>);
map_access!(MetaZoneSpecificNamesLongV1<'s> => MetaZoneSpecificNamesV1<'s>: 's);
#[derive(PartialEq, Debug, Clone, Default)]
#[cfg_attr(
feature = "provider_serde",
derive(serde::Serialize, serde::Deserialize)
)]
pub struct MetaZoneSpecificNamesShortV1<'s>(pub LiteMap<Cow<'s, str>, MetaZoneSpecificNamesV1<'s>>);
map_access!(MetaZoneSpecificNamesShortV1<'s> => MetaZoneSpecificNamesV1<'s>: 's);
#[derive(PartialEq, Debug, Clone, Default)]
#[cfg_attr(
feature = "provider_serde",
derive(serde::Serialize, serde::Deserialize)
)]
pub struct MetaZoneSpecificNamesV1<'s>(pub LiteMap<Cow<'s, str>, Cow<'s, str>>);
map_access!(MetaZoneSpecificNamesV1<'s> => Cow<'s, str>: 's);