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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("input token was expected but reached EOF")]
TokenExpected,
#[error("version must be the first property")]
VersionMisplaced,
#[error("control characters are not allowed, got '{0}'")]
ControlCharacter(String),
#[error("input token '{0}' was incorrect")]
IncorrectToken(String),
#[error("unknown parameter '{0}'")]
UnknownParameter(String),
#[error("property name '{0}' is not supported")]
UnknownPropertyName(String),
#[error("property value is invalid")]
InvalidPropertyValue,
#[error("time '{0}' is invalid")]
InvalidTime(String),
#[error("date '{0}' is invalid")]
InvalidDate(String),
#[error("delivery address '{0}' is invalid")]
InvalidAddress(String),
#[error("parameter LABEL can only be applied to ADR but used on '{0}'")]
InvalidLabel(String),
#[error("value '{0}' is not a valid boolean")]
InvalidBoolean(String),
#[error("client PID map '{0}' is not valid")]
InvalidClientPidMap(String),
#[error("property or parameter delimiter expected")]
DelimiterExpected,
#[error("value type '{0}' is not supported")]
UnknownValueType(String),
#[error("related type value '{0}' is not supported")]
UnknownRelatedType(String),
#[error("telephone type value '{0}' is not supported")]
UnknownTelephoneType(String),
#[error("value '{0}' is not supported in this context '{1}'")]
UnsupportedValueType(String, String),
#[error("kind '{0}' is not supported")]
UnknownKind(String),
#[error("sex '{0}' is not supported")]
UnknownSex(String),
#[error("gender value is missing sex")]
NoSex,
#[error("property '{0}' may only appear exactly once")]
OnlyOnce(String),
#[error("formatted name (FN) is required")]
NoFormattedName,
#[error("date time '{0}' is not valid, maybe missing 'T' delimiter")]
InvalidDateTime(String),
#[error("TYPE parameter is not supported for property '{0}'")]
TypeParameter(String),
#[error("pref '{0}' is out of bounds, must be between 1 and 100")]
PrefOutOfRange(u8),
#[error("pid '{0}' is invalid")]
InvalidPid(String),
#[error("'{0}' must be enclosed in quotes")]
NotQuoted(String),
#[error("member property is only allowed when the kind is group")]
MemberRequiresGroup,
#[error("PID parameter not allowed for CLIENTPIDMAP")]
ClientPidMapPidNotAllowed,
#[cfg(feature = "language-tags")]
#[error(transparent)]
LanguageParse(#[from] language_tags::ParseError),
#[error(transparent)]
UriParse(#[from] uriparse::uri::URIError),
#[error(transparent)]
ComponentRange(#[from] time::error::ComponentRange),
#[error(transparent)]
TimeParse(#[from] time::error::Parse),
#[error(transparent)]
TimeFormat(#[from] time::error::Format),
#[error(transparent)]
TimeInvalidFormat(#[from] time::error::InvalidFormatDescription),
#[error(transparent)]
ParseInt(#[from] std::num::ParseIntError),
#[error(transparent)]
ParseFloat(#[from] std::num::ParseFloatError),
#[cfg(feature = "mime")]
#[error(transparent)]
Mime(#[from] mime::FromStrError),
}