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
//! The [`Error`] and [`Whatever`] traits.
use Error as StdError;
use ;
/// Abstraction for types that can be carried by a [`Report`](crate::Report).
///
/// Implemented automatically for any [`std::error::Error`]. Implement it directly for
/// types that are not [`std::error::Error`]s but should still be reportable (e.g., simple
/// marker types created with [`new_whatever_type!`](crate::new_whatever_type)).
/// Error type that opts into one-off, freeform diagnostic reports.
///
/// Types implementing this trait can be constructed from arbitrary other errors, which
/// [`ResultExt::whatever`](crate::ResultExt::whatever) and
/// [`ErrorExt::whatever`](crate::ErrorExt::whatever) rely on. Use
/// [`new_whatever_type!`](crate::new_whatever_type) to define one.
///
/// A `Whatever` type never carries its own message. Callers must always describe what
/// failed at the call site, e.g., via `.whatever("unable to read configuration")`,
/// instead of relying on a generic, type-level placeholder.