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
/// Defines `print` macro that defines a print macro that uses the specified writer.
///
/// The first argument specifies the generated macro name.
/// The writer itself is specified by the rest arguments with the [`define_writer`] macros.
///
/// See also [`define_println`] and [`define_try_print`] macros.
///
/// # Examples
///
/// ```rust
/// let mut string = String::new();
/// custom_print::define_print!(cprint, fmt, |value: &str| string += value);
///
/// assert_eq!(cprint!("value"), ());
/// assert_eq!(string, "value");
/// ```
///
/// [`define_writer`]: macro.define_writer.html
/// [`define_println`]: macro.define_println.html
/// [`define_try_print`]: macro.define_try_print.html
/// Defines `println` macro that defines a println macro that uses the specified writer.
///
/// The first argument specifies the generated macro name.
/// The writer itself is specified by the rest arguments with the [`define_writer`] macros.
///
/// See also [`define_print`] and [`define_try_println`] macros.
///
/// # Examples
///
/// ```rust
/// let mut string = String::new();
/// custom_print::define_println!(cprintln, fmt, |value: &str| string += value);
///
/// assert_eq!(cprintln!("value"), ());
/// assert_eq!(string, "value\n");
/// ```
///
/// [`define_writer`]: macro.define_writer.html
/// [`define_print`]: macro.define_print.html
/// [`define_try_println`]: macro.define_try_println.html
/// Defines `try_print` macro that defines a fallible print macro that uses the specified writer.
///
/// The first argument specifies the generated macro name.
/// The writer itself is specified by the rest arguments with the [`define_writer`] macros.
///
/// See also [`define_print`] and [`define_try_println`] macros.
///
/// # Examples
///
/// ```rust
/// let mut string = String::new();
/// custom_print::define_try_print!(try_print, fmt, |value: &str| string += value);
///
/// assert_eq!(try_print!("value"), Ok(()));
/// assert_eq!(string, "value");
/// ```
///
/// [`define_writer`]: macro.define_writer.html
/// [`define_print`]: macro.define_print.html
/// [`define_try_println`]: macro.define_try_println.html
/// Defines `try_println` macro that defines
/// a fallible println macro that uses the specified writer.
///
/// The first argument specifies the generated macro name.
/// The writer itself is specified by the rest arguments with the [`define_writer`] macros.
///
/// See also [`define_println`] and [`define_try_print`] macros.
///
/// # Examples
///
/// ```rust
/// let mut string = String::new();
/// custom_print::define_try_println!(try_println, fmt, |value: &str| string += value);
///
/// assert_eq!(try_println!("value"), Ok(()));
/// assert_eq!(string, "value\n");
/// ```
///
/// [`define_writer`]: macro.define_writer.html
/// [`define_println`]: macro.define_println.html
/// [`define_try_print`]: macro.define_try_print.html