@@ -4,7 +4,7 @@
|
||||
mod tests;
|
||||
|
||||
use crate::fmt;
|
||||
use crate::io::{self, BufRead, Initializer, IoSlice, IoSliceMut, Read, Write};
|
||||
use crate::io::{self, BufRead, Initializer, IoSlice, IoSliceMut, Read, Seek, SeekFrom, Write};
|
||||
|
||||
/// A reader which is always at EOF.
|
||||
///
|
||||
@@ -58,6 +58,21 @@ impl BufRead for Empty {
|
||||
fn consume(&mut self, _n: usize) {}
|
||||
}
|
||||
|
||||
#[stable(feature = "empty_seek", since = "1.51.0")]
|
||||
impl Seek for Empty {
|
||||
fn seek(&mut self, _pos: SeekFrom) -> io::Result<u64> {
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
fn stream_len(&mut self) -> io::Result<u64> {
|
||||
Ok(0)
|
||||
}
|
||||
|
||||
fn stream_position(&mut self) -> io::Result<u64> {
|
||||
Ok(0)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "std_debug", since = "1.16.0")]
|
||||
impl fmt::Debug for Empty {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
|
||||
Reference in New Issue
Block a user