@@ -68,27 +68,81 @@ impl Read for Empty {
68
68
fn read_buf(&mut self, _cursor: BorrowedCursor<'_>) -> io::Result<()> {
69
69
Ok(())
70
70
}
71
+
72
+ #[inline]
73
+ fn read_vectored(&mut self, _bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
74
+ Ok(0)
75
+ }
76
+
77
+ #[inline]
78
+ fn is_read_vectored(&self) -> bool {
79
+ true
80
+ }
81
+
82
+ #[inline]
83
+ fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
84
+ if !buf.is_empty() { Err(io::Error::READ_EXACT_EOF) } else { Ok(()) }
85
+ }
86
+
87
+ #[inline]
88
+ fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> io::Result<()> {
89
+ if cursor.capacity() != 0 { Err(io::Error::READ_EXACT_EOF) } else { Ok(()) }
90
+ }
91
+
92
+ #[inline]
93
+ fn read_to_end(&mut self, _buf: &mut Vec<u8>) -> io::Result<usize> {
94
+ Ok(0)
95
+ }
96
+
97
+ #[inline]
98
+ fn read_to_string(&mut self, _buf: &mut String) -> io::Result<usize> {
99
+ Ok(0)
100
+ }
71
101
}
72
102
#[stable(feature = "rust1", since = "1.0.0")]
73
103
impl BufRead for Empty {
74
104
#[inline]
75
105
fn fill_buf(&mut self) -> io::Result<&[u8]> {
76
106
Ok(&[])
77
107
}
108
+
78
109
#[inline]
79
110
fn consume(&mut self, _n: usize) {}
111
+
112
+ #[inline]
113
+ fn has_data_left(&mut self) -> io::Result<bool> {
114
+ Ok(false)
115
+ }
116
+
117
+ #[inline]
118
+ fn read_until(&mut self, _byte: u8, _buf: &mut Vec<u8>) -> io::Result<usize> {
119
+ Ok(0)
120
+ }
121
+
122
+ #[inline]
123
+ fn skip_until(&mut self, _byte: u8) -> io::Result<usize> {
124
+ Ok(0)
125
+ }
126
+
127
+ #[inline]
128
+ fn read_line(&mut self, _buf: &mut String) -> io::Result<usize> {
129
+ Ok(0)
130
+ }
80
131
}
81
132
82
133
#[stable(feature = "empty_seek", since = "1.51.0")]
83
134
impl Seek for Empty {
135
+ #[inline]
84
136
fn seek(&mut self, _pos: SeekFrom) -> io::Result<u64> {
85
137
Ok(0)
86
138
}
87
139
140
+ #[inline]
88
141
fn stream_len(&mut self) -> io::Result<u64> {
89
142
Ok(0)
90
143
}
91
144
145
+ #[inline]
92
146
fn stream_position(&mut self) -> io::Result<u64> {
93
147
Ok(0)
94
148
}
@@ -119,6 +173,21 @@ impl Write for Empty {
119
173
true
120
174
}
121
175
176
+ #[inline]
177
+ fn write_all(&mut self, _buf: &[u8]) -> io::Result<()> {
178
+ Ok(())
179
+ }
180
+
181
+ #[inline]
182
+ fn write_all_vectored(&mut self, _bufs: &mut [IoSlice<'_>]) -> io::Result<()> {
183
+ Ok(())
184
+ }
185
+
186
+ #[inline]
187
+ fn write_fmt(&mut self, _fmt: fmt::Arguments<'_>) -> io::Result<()> {
188
+ Ok(())
189
+ }
190
+
122
191
#[inline]
123
192
fn flush(&mut self) -> io::Result<()> {
124
193
Ok(())
@@ -143,6 +212,21 @@ impl Write for &Empty {
143
212
true
144
213
}
145
214
215
+ #[inline]
216
+ fn write_all(&mut self, _buf: &[u8]) -> io::Result<()> {
217
+ Ok(())
218
+ }
219
+
220
+ #[inline]
221
+ fn write_all_vectored(&mut self, _bufs: &mut [IoSlice<'_>]) -> io::Result<()> {
222
+ Ok(())
223
+ }
224
+
225
+ #[inline]
226
+ fn write_fmt(&mut self, _fmt: fmt::Arguments<'_>) -> io::Result<()> {
227
+ Ok(())
228
+ }
229
+
146
230
#[inline]
147
231
fn flush(&mut self) -> io::Result<()> {
148
232
Ok(())
@@ -302,6 +386,21 @@ impl Write for Sink {
302
386
true
303
387
}
304
388
389
+ #[inline]
390
+ fn write_all(&mut self, _buf: &[u8]) -> io::Result<()> {
391
+ Ok(())
392
+ }
393
+
394
+ #[inline]
395
+ fn write_all_vectored(&mut self, _bufs: &mut [IoSlice<'_>]) -> io::Result<()> {
396
+ Ok(())
397
+ }
398
+
399
+ #[inline]
400
+ fn write_fmt(&mut self, _fmt: fmt::Arguments<'_>) -> io::Result<()> {
401
+ Ok(())
402
+ }
403
+
305
404
#[inline]
306
405
fn flush(&mut self) -> io::Result<()> {
307
406
Ok(())
@@ -326,6 +425,21 @@ impl Write for &Sink {
326
425
true
327
426
}
328
427
428
+ #[inline]
429
+ fn write_all(&mut self, _buf: &[u8]) -> io::Result<()> {
430
+ Ok(())
431
+ }
432
+
433
+ #[inline]
434
+ fn write_all_vectored(&mut self, _bufs: &mut [IoSlice<'_>]) -> io::Result<()> {
435
+ Ok(())
436
+ }
437
+
438
+ #[inline]
439
+ fn write_fmt(&mut self, _fmt: fmt::Arguments<'_>) -> io::Result<()> {
440
+ Ok(())
441
+ }
442
+
329
443
#[inline]
330
444
fn flush(&mut self) -> io::Result<()> {
331
445
Ok(())
0 commit comments