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
/// Helper macro to generate builder pattern methods for a struct.
///
/// # Example
/// ```
/// pub struct EmitterConfig {
/// pub line_separator: String,
/// pub indent_string: String
/// }
///
/// impl EmitterConfig {
/// pub fn new() -> EmitterConfig {
/// EmitterConfig {
/// line_separator: "\n".to_owned(),
/// indent_string: " ".to_owned()
/// }
/// }
/// }
///
/// gen_setters!(EmitterConfig,
/// line_separator: String,
/// indent_string: String
/// );
///
/// fn main() {
/// let config = EmitterConfig::new().line_separator("\r\n".to_owned());
/// }
/// ```
;
/// Helper macro for unwrapping a result if possible, continuing the loop
/// if the value is an error.
;
/// Helper macro for unwrapping an Option if possible, continuing the loop
/// if the value is None.
;
/// Helper macro for unwrapping a Result if possible, returns the given error otherwise.
;
/// Helper macro for unwrapping a Result if possible, returns an `fmt::Error` otherwise.
;
/// Helper macro that tests if the given expression matches a given pattern.
///
/// # Example
/// ```
/// enum E { First, Second }
///
/// fn foo {
/// let v: Vec<E> = Vec::new();
/// v.filter(|e| matches!(e, First));
/// }
/// ```
;