1#[allow(unused_imports)]
18use std::collections::HashMap;
19use std::convert::From;
20use std::error::Error;
21use std::fmt;
22
23#[derive(Clone, Default, Debug)]
24pub struct CreateRequest<'a> {
25 pub name: &'a str,
27 pub handle: Option<&'a str>,
29 pub description: Option<&'a str>,
31 pub channels: Option<&'a str>,
33 pub include_count: Option<bool>,
35}
36
37#[derive(Clone, Debug, Deserialize)]
38pub struct CreateResponse {
39 error: Option<String>,
40 #[serde(default)]
41 ok: bool,
42 pub usergroup: Option<crate::Usergroup>,
43}
44
45impl<E: Error> Into<Result<CreateResponse, CreateError<E>>> for CreateResponse {
46 fn into(self) -> Result<CreateResponse, CreateError<E>> {
47 if self.ok {
48 Ok(self)
49 } else {
50 Err(self.error.as_ref().map(String::as_ref).unwrap_or("").into())
51 }
52 }
53}
54#[derive(Debug)]
55pub enum CreateError<E: Error> {
56 NotAuthed,
58 InvalidAuth,
60 AccountInactive,
62 UserIsBot,
64 UserIsRestricted,
66 InvalidArgName,
68 InvalidArrayArg,
70 InvalidCharset,
72 InvalidFormData,
74 InvalidPostType,
76 MissingPostType,
78 TeamAddedToOrg,
80 RequestTimeout,
82 MalformedResponse(String, serde_json::error::Error),
84 Unknown(String),
86 Client(E),
88}
89
90impl<'a, E: Error> From<&'a str> for CreateError<E> {
91 fn from(s: &'a str) -> Self {
92 match s {
93 "not_authed" => CreateError::NotAuthed,
94 "invalid_auth" => CreateError::InvalidAuth,
95 "account_inactive" => CreateError::AccountInactive,
96 "user_is_bot" => CreateError::UserIsBot,
97 "user_is_restricted" => CreateError::UserIsRestricted,
98 "invalid_arg_name" => CreateError::InvalidArgName,
99 "invalid_array_arg" => CreateError::InvalidArrayArg,
100 "invalid_charset" => CreateError::InvalidCharset,
101 "invalid_form_data" => CreateError::InvalidFormData,
102 "invalid_post_type" => CreateError::InvalidPostType,
103 "missing_post_type" => CreateError::MissingPostType,
104 "team_added_to_org" => CreateError::TeamAddedToOrg,
105 "request_timeout" => CreateError::RequestTimeout,
106 _ => CreateError::Unknown(s.to_owned()),
107 }
108 }
109}
110
111impl<E: Error> fmt::Display for CreateError<E> {
112 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
113 let d = match *self {
114 CreateError::NotAuthed => "not_authed: No authentication token provided.",
115CreateError::InvalidAuth => "invalid_auth: Invalid authentication token.",
116CreateError::AccountInactive => "account_inactive: Authentication token is for a deleted user or team.",
117CreateError::UserIsBot => "user_is_bot: This method cannot be called by a bot user.",
118CreateError::UserIsRestricted => "user_is_restricted: This method cannot be called by a restricted user or single channel guest.",
119CreateError::InvalidArgName => "invalid_arg_name: The method was passed an argument whose name falls outside the bounds of common decency. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.",
120CreateError::InvalidArrayArg => "invalid_array_arg: The method was passed a PHP-style array argument (e.g. with a name like foo[7]). These are never valid with the Slack API.",
121CreateError::InvalidCharset => "invalid_charset: The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.",
122CreateError::InvalidFormData => "invalid_form_data: The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.",
123CreateError::InvalidPostType => "invalid_post_type: The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/x-www-form-urlencoded multipart/form-data text/plain.",
124CreateError::MissingPostType => "missing_post_type: The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.",
125CreateError::TeamAddedToOrg => "team_added_to_org: The team associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.",
126CreateError::RequestTimeout => "request_timeout: The method was called via a POST request, but the POST data was either missing or truncated.",
127 CreateError::MalformedResponse(_, ref e) => return write!(f, "{}", e),
128 CreateError::Unknown(ref s) => return write!(f, "{}", s),
129 CreateError::Client(ref inner) => return write!(f, "{}", inner),
130 };
131 write!(f, "{}", d)
132 }
133}
134
135impl<E: Error + 'static> Error for CreateError<E> {
136 fn source(&self) -> Option<&(dyn Error + 'static)> {
137 match *self {
138 CreateError::MalformedResponse(_, ref e) => Some(e),
139 CreateError::Client(ref inner) => Some(inner),
140 _ => None,
141 }
142 }
143}
144
145#[derive(Clone, Default, Debug)]
146pub struct DisableRequest<'a> {
147 pub usergroup: &'a str,
149 pub include_count: Option<bool>,
151}
152
153#[derive(Clone, Debug, Deserialize)]
154pub struct DisableResponse {
155 error: Option<String>,
156 #[serde(default)]
157 ok: bool,
158 pub usergroup: Option<crate::Usergroup>,
159}
160
161impl<E: Error> Into<Result<DisableResponse, DisableError<E>>> for DisableResponse {
162 fn into(self) -> Result<DisableResponse, DisableError<E>> {
163 if self.ok {
164 Ok(self)
165 } else {
166 Err(self.error.as_ref().map(String::as_ref).unwrap_or("").into())
167 }
168 }
169}
170#[derive(Debug)]
171pub enum DisableError<E: Error> {
172 NotAuthed,
174 InvalidAuth,
176 AccountInactive,
178 UserIsBot,
180 UserIsRestricted,
182 InvalidArgName,
184 InvalidArrayArg,
186 InvalidCharset,
188 InvalidFormData,
190 InvalidPostType,
192 MissingPostType,
194 TeamAddedToOrg,
196 RequestTimeout,
198 MalformedResponse(String, serde_json::error::Error),
200 Unknown(String),
202 Client(E),
204}
205
206impl<'a, E: Error> From<&'a str> for DisableError<E> {
207 fn from(s: &'a str) -> Self {
208 match s {
209 "not_authed" => DisableError::NotAuthed,
210 "invalid_auth" => DisableError::InvalidAuth,
211 "account_inactive" => DisableError::AccountInactive,
212 "user_is_bot" => DisableError::UserIsBot,
213 "user_is_restricted" => DisableError::UserIsRestricted,
214 "invalid_arg_name" => DisableError::InvalidArgName,
215 "invalid_array_arg" => DisableError::InvalidArrayArg,
216 "invalid_charset" => DisableError::InvalidCharset,
217 "invalid_form_data" => DisableError::InvalidFormData,
218 "invalid_post_type" => DisableError::InvalidPostType,
219 "missing_post_type" => DisableError::MissingPostType,
220 "team_added_to_org" => DisableError::TeamAddedToOrg,
221 "request_timeout" => DisableError::RequestTimeout,
222 _ => DisableError::Unknown(s.to_owned()),
223 }
224 }
225}
226
227impl<E: Error> fmt::Display for DisableError<E> {
228 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
229 let d = match *self {
230 DisableError::NotAuthed => "not_authed: No authentication token provided.",
231DisableError::InvalidAuth => "invalid_auth: Invalid authentication token.",
232DisableError::AccountInactive => "account_inactive: Authentication token is for a deleted user or team.",
233DisableError::UserIsBot => "user_is_bot: This method cannot be called by a bot user.",
234DisableError::UserIsRestricted => "user_is_restricted: This method cannot be called by a restricted user or single channel guest.",
235DisableError::InvalidArgName => "invalid_arg_name: The method was passed an argument whose name falls outside the bounds of common decency. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.",
236DisableError::InvalidArrayArg => "invalid_array_arg: The method was passed a PHP-style array argument (e.g. with a name like foo[7]). These are never valid with the Slack API.",
237DisableError::InvalidCharset => "invalid_charset: The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.",
238DisableError::InvalidFormData => "invalid_form_data: The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.",
239DisableError::InvalidPostType => "invalid_post_type: The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/x-www-form-urlencoded multipart/form-data text/plain.",
240DisableError::MissingPostType => "missing_post_type: The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.",
241DisableError::TeamAddedToOrg => "team_added_to_org: The team associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.",
242DisableError::RequestTimeout => "request_timeout: The method was called via a POST request, but the POST data was either missing or truncated.",
243 DisableError::MalformedResponse(_, ref e) => return write!(f, "{}", e),
244 DisableError::Unknown(ref s) => return write!(f, "{}", s),
245 DisableError::Client(ref inner) => return write!(f, "{}", inner),
246 };
247 write!(f, "{}", d)
248 }
249}
250
251impl<E: Error + 'static> Error for DisableError<E> {
252 fn source(&self) -> Option<&(dyn Error + 'static)> {
253 match *self {
254 DisableError::MalformedResponse(_, ref e) => Some(e),
255 DisableError::Client(ref inner) => Some(inner),
256 _ => None,
257 }
258 }
259}
260
261#[derive(Clone, Default, Debug)]
262pub struct EnableRequest<'a> {
263 pub usergroup: &'a str,
265 pub include_count: Option<bool>,
267}
268
269#[derive(Clone, Debug, Deserialize)]
270pub struct EnableResponse {
271 error: Option<String>,
272 #[serde(default)]
273 ok: bool,
274 pub usergroup: Option<crate::Usergroup>,
275}
276
277impl<E: Error> Into<Result<EnableResponse, EnableError<E>>> for EnableResponse {
278 fn into(self) -> Result<EnableResponse, EnableError<E>> {
279 if self.ok {
280 Ok(self)
281 } else {
282 Err(self.error.as_ref().map(String::as_ref).unwrap_or("").into())
283 }
284 }
285}
286#[derive(Debug)]
287pub enum EnableError<E: Error> {
288 NotAuthed,
290 InvalidAuth,
292 AccountInactive,
294 UserIsBot,
296 UserIsRestricted,
298 InvalidArgName,
300 InvalidArrayArg,
302 InvalidCharset,
304 InvalidFormData,
306 InvalidPostType,
308 MissingPostType,
310 TeamAddedToOrg,
312 RequestTimeout,
314 MalformedResponse(String, serde_json::error::Error),
316 Unknown(String),
318 Client(E),
320}
321
322impl<'a, E: Error> From<&'a str> for EnableError<E> {
323 fn from(s: &'a str) -> Self {
324 match s {
325 "not_authed" => EnableError::NotAuthed,
326 "invalid_auth" => EnableError::InvalidAuth,
327 "account_inactive" => EnableError::AccountInactive,
328 "user_is_bot" => EnableError::UserIsBot,
329 "user_is_restricted" => EnableError::UserIsRestricted,
330 "invalid_arg_name" => EnableError::InvalidArgName,
331 "invalid_array_arg" => EnableError::InvalidArrayArg,
332 "invalid_charset" => EnableError::InvalidCharset,
333 "invalid_form_data" => EnableError::InvalidFormData,
334 "invalid_post_type" => EnableError::InvalidPostType,
335 "missing_post_type" => EnableError::MissingPostType,
336 "team_added_to_org" => EnableError::TeamAddedToOrg,
337 "request_timeout" => EnableError::RequestTimeout,
338 _ => EnableError::Unknown(s.to_owned()),
339 }
340 }
341}
342
343impl<E: Error> fmt::Display for EnableError<E> {
344 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
345 let d = match *self {
346 EnableError::NotAuthed => "not_authed: No authentication token provided.",
347EnableError::InvalidAuth => "invalid_auth: Invalid authentication token.",
348EnableError::AccountInactive => "account_inactive: Authentication token is for a deleted user or team.",
349EnableError::UserIsBot => "user_is_bot: This method cannot be called by a bot user.",
350EnableError::UserIsRestricted => "user_is_restricted: This method cannot be called by a restricted user or single channel guest.",
351EnableError::InvalidArgName => "invalid_arg_name: The method was passed an argument whose name falls outside the bounds of common decency. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.",
352EnableError::InvalidArrayArg => "invalid_array_arg: The method was passed a PHP-style array argument (e.g. with a name like foo[7]). These are never valid with the Slack API.",
353EnableError::InvalidCharset => "invalid_charset: The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.",
354EnableError::InvalidFormData => "invalid_form_data: The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.",
355EnableError::InvalidPostType => "invalid_post_type: The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/x-www-form-urlencoded multipart/form-data text/plain.",
356EnableError::MissingPostType => "missing_post_type: The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.",
357EnableError::TeamAddedToOrg => "team_added_to_org: The team associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.",
358EnableError::RequestTimeout => "request_timeout: The method was called via a POST request, but the POST data was either missing or truncated.",
359 EnableError::MalformedResponse(_, ref e) => return write!(f, "{}", e),
360 EnableError::Unknown(ref s) => return write!(f, "{}", s),
361 EnableError::Client(ref inner) => return write!(f, "{}", inner),
362 };
363 write!(f, "{}", d)
364 }
365}
366
367impl<E: Error + 'static> Error for EnableError<E> {
368 fn source(&self) -> Option<&(dyn Error + 'static)> {
369 match *self {
370 EnableError::MalformedResponse(_, ref e) => Some(e),
371 EnableError::Client(ref inner) => Some(inner),
372 _ => None,
373 }
374 }
375}
376
377#[derive(Clone, Default, Debug)]
378pub struct ListRequest {
379 pub include_disabled: Option<bool>,
381 pub include_count: Option<bool>,
383 pub include_users: Option<bool>,
385}
386
387#[derive(Clone, Debug, Deserialize)]
388pub struct ListResponse {
389 error: Option<String>,
390 #[serde(default)]
391 ok: bool,
392 pub usergroups: Option<Vec<crate::Usergroup>>,
393}
394
395impl<E: Error> Into<Result<ListResponse, ListError<E>>> for ListResponse {
396 fn into(self) -> Result<ListResponse, ListError<E>> {
397 if self.ok {
398 Ok(self)
399 } else {
400 Err(self.error.as_ref().map(String::as_ref).unwrap_or("").into())
401 }
402 }
403}
404#[derive(Debug)]
405pub enum ListError<E: Error> {
406 NotAuthed,
408 InvalidAuth,
410 AccountInactive,
412 UserIsBot,
414 UserIsRestricted,
416 InvalidArgName,
418 InvalidArrayArg,
420 InvalidCharset,
422 InvalidFormData,
424 InvalidPostType,
426 MissingPostType,
428 TeamAddedToOrg,
430 RequestTimeout,
432 MalformedResponse(String, serde_json::error::Error),
434 Unknown(String),
436 Client(E),
438}
439
440impl<'a, E: Error> From<&'a str> for ListError<E> {
441 fn from(s: &'a str) -> Self {
442 match s {
443 "not_authed" => ListError::NotAuthed,
444 "invalid_auth" => ListError::InvalidAuth,
445 "account_inactive" => ListError::AccountInactive,
446 "user_is_bot" => ListError::UserIsBot,
447 "user_is_restricted" => ListError::UserIsRestricted,
448 "invalid_arg_name" => ListError::InvalidArgName,
449 "invalid_array_arg" => ListError::InvalidArrayArg,
450 "invalid_charset" => ListError::InvalidCharset,
451 "invalid_form_data" => ListError::InvalidFormData,
452 "invalid_post_type" => ListError::InvalidPostType,
453 "missing_post_type" => ListError::MissingPostType,
454 "team_added_to_org" => ListError::TeamAddedToOrg,
455 "request_timeout" => ListError::RequestTimeout,
456 _ => ListError::Unknown(s.to_owned()),
457 }
458 }
459}
460
461impl<E: Error> fmt::Display for ListError<E> {
462 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
463 let d = match *self {
464 ListError::NotAuthed => "not_authed: No authentication token provided.",
465ListError::InvalidAuth => "invalid_auth: Invalid authentication token.",
466ListError::AccountInactive => "account_inactive: Authentication token is for a deleted user or team.",
467ListError::UserIsBot => "user_is_bot: This method cannot be called by a bot user.",
468ListError::UserIsRestricted => "user_is_restricted: This method cannot be called by a restricted user or single channel guest.",
469ListError::InvalidArgName => "invalid_arg_name: The method was passed an argument whose name falls outside the bounds of common decency. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.",
470ListError::InvalidArrayArg => "invalid_array_arg: The method was passed a PHP-style array argument (e.g. with a name like foo[7]). These are never valid with the Slack API.",
471ListError::InvalidCharset => "invalid_charset: The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.",
472ListError::InvalidFormData => "invalid_form_data: The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.",
473ListError::InvalidPostType => "invalid_post_type: The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/x-www-form-urlencoded multipart/form-data text/plain.",
474ListError::MissingPostType => "missing_post_type: The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.",
475ListError::TeamAddedToOrg => "team_added_to_org: The team associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.",
476ListError::RequestTimeout => "request_timeout: The method was called via a POST request, but the POST data was either missing or truncated.",
477 ListError::MalformedResponse(_, ref e) => return write!(f, "{}", e),
478 ListError::Unknown(ref s) => return write!(f, "{}", s),
479 ListError::Client(ref inner) => return write!(f, "{}", inner),
480 };
481 write!(f, "{}", d)
482 }
483}
484
485impl<E: Error + 'static> Error for ListError<E> {
486 fn source(&self) -> Option<&(dyn Error + 'static)> {
487 match *self {
488 ListError::MalformedResponse(_, ref e) => Some(e),
489 ListError::Client(ref inner) => Some(inner),
490 _ => None,
491 }
492 }
493}
494
495#[derive(Clone, Default, Debug)]
496pub struct UpdateRequest<'a> {
497 pub usergroup: &'a str,
499 pub name: Option<&'a str>,
501 pub handle: Option<&'a str>,
503 pub description: Option<&'a str>,
505 pub channels: Option<&'a str>,
507 pub include_count: Option<bool>,
509}
510
511#[derive(Clone, Debug, Deserialize)]
512pub struct UpdateResponse {
513 error: Option<String>,
514 #[serde(default)]
515 ok: bool,
516 pub usergroup: Option<crate::Usergroup>,
517}
518
519impl<E: Error> Into<Result<UpdateResponse, UpdateError<E>>> for UpdateResponse {
520 fn into(self) -> Result<UpdateResponse, UpdateError<E>> {
521 if self.ok {
522 Ok(self)
523 } else {
524 Err(self.error.as_ref().map(String::as_ref).unwrap_or("").into())
525 }
526 }
527}
528#[derive(Debug)]
529pub enum UpdateError<E: Error> {
530 NotAuthed,
532 InvalidAuth,
534 AccountInactive,
536 UserIsBot,
538 UserIsRestricted,
540 InvalidArgName,
542 InvalidArrayArg,
544 InvalidCharset,
546 InvalidFormData,
548 InvalidPostType,
550 MissingPostType,
552 TeamAddedToOrg,
554 RequestTimeout,
556 MalformedResponse(String, serde_json::error::Error),
558 Unknown(String),
560 Client(E),
562}
563
564impl<'a, E: Error> From<&'a str> for UpdateError<E> {
565 fn from(s: &'a str) -> Self {
566 match s {
567 "not_authed" => UpdateError::NotAuthed,
568 "invalid_auth" => UpdateError::InvalidAuth,
569 "account_inactive" => UpdateError::AccountInactive,
570 "user_is_bot" => UpdateError::UserIsBot,
571 "user_is_restricted" => UpdateError::UserIsRestricted,
572 "invalid_arg_name" => UpdateError::InvalidArgName,
573 "invalid_array_arg" => UpdateError::InvalidArrayArg,
574 "invalid_charset" => UpdateError::InvalidCharset,
575 "invalid_form_data" => UpdateError::InvalidFormData,
576 "invalid_post_type" => UpdateError::InvalidPostType,
577 "missing_post_type" => UpdateError::MissingPostType,
578 "team_added_to_org" => UpdateError::TeamAddedToOrg,
579 "request_timeout" => UpdateError::RequestTimeout,
580 _ => UpdateError::Unknown(s.to_owned()),
581 }
582 }
583}
584
585impl<E: Error> fmt::Display for UpdateError<E> {
586 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
587 let d = match *self {
588 UpdateError::NotAuthed => "not_authed: No authentication token provided.",
589UpdateError::InvalidAuth => "invalid_auth: Invalid authentication token.",
590UpdateError::AccountInactive => "account_inactive: Authentication token is for a deleted user or team.",
591UpdateError::UserIsBot => "user_is_bot: This method cannot be called by a bot user.",
592UpdateError::UserIsRestricted => "user_is_restricted: This method cannot be called by a restricted user or single channel guest.",
593UpdateError::InvalidArgName => "invalid_arg_name: The method was passed an argument whose name falls outside the bounds of common decency. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.",
594UpdateError::InvalidArrayArg => "invalid_array_arg: The method was passed a PHP-style array argument (e.g. with a name like foo[7]). These are never valid with the Slack API.",
595UpdateError::InvalidCharset => "invalid_charset: The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.",
596UpdateError::InvalidFormData => "invalid_form_data: The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.",
597UpdateError::InvalidPostType => "invalid_post_type: The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/x-www-form-urlencoded multipart/form-data text/plain.",
598UpdateError::MissingPostType => "missing_post_type: The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.",
599UpdateError::TeamAddedToOrg => "team_added_to_org: The team associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.",
600UpdateError::RequestTimeout => "request_timeout: The method was called via a POST request, but the POST data was either missing or truncated.",
601 UpdateError::MalformedResponse(_, ref e) => return write!(f, "{}", e),
602 UpdateError::Unknown(ref s) => return write!(f, "{}", s),
603 UpdateError::Client(ref inner) => return write!(f, "{}", inner),
604 };
605 write!(f, "{}", d)
606 }
607}
608
609impl<E: Error + 'static> Error for UpdateError<E> {
610 fn source(&self) -> Option<&(dyn Error + 'static)> {
611 match *self {
612 UpdateError::MalformedResponse(_, ref e) => Some(e),
613 UpdateError::Client(ref inner) => Some(inner),
614 _ => None,
615 }
616 }
617}