#[non_exhaustive]pub struct Empty;
Expand description
Trait Implementations
sourceimpl BufRead for Empty
impl BufRead for Empty
sourcefn fill_buf(&mut self) -> Result<&[u8]>
fn fill_buf(&mut self) -> Result<&[u8]>
Returns the contents of the internal buffer, filling it with more data
from the inner reader if it is empty. Read more
sourcefn consume(&mut self, _n: usize)
fn consume(&mut self, _n: usize)
Tells this buffer that
amt
bytes have been consumed from the buffer,
so they should no longer be returned in calls to read
. Read moresourcefn has_data_left(&mut self) -> Result<bool>
fn has_data_left(&mut self) -> Result<bool>
🔬This is a nightly-only experimental API. (
buf_read_has_data_left
#86423)Check if the underlying
Read
has any data left to be read. Read moresourcefn read_line(&mut self, buf: &mut String) -> Result<usize>
fn read_line(&mut self, buf: &mut String) -> Result<usize>
Read all bytes until a newline (the
0xA
byte) is reached, and append
them to the provided buffer. You do not need to clear the buffer before
appending. Read moresourceimpl Read for Empty
impl Read for Empty
sourcefn read(&mut self, _buf: &mut [u8]) -> Result<usize>
fn read(&mut self, _buf: &mut [u8]) -> Result<usize>
Pull some bytes from this source into the specified buffer, returning
how many bytes were read. Read more
sourcefn read_buf(&mut self, _cursor: BorrowedCursor<'_>) -> Result<()>
fn read_buf(&mut self, _cursor: BorrowedCursor<'_>) -> Result<()>
🔬This is a nightly-only experimental API. (
read_buf
#78485)Pull some bytes from this source into the specified buffer. Read more
1.36.0 · sourcefn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
Like
read
, except that it reads into a slice of buffers. Read moresourcefn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
#69941)sourcefn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
Read all bytes until EOF in this source, placing them into
buf
. Read moresourcefn read_to_string(&mut self, buf: &mut String) -> Result<usize>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
Read all bytes until EOF in this source, appending them to
buf
. Read more1.6.0 · sourcefn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
Read the exact number of bytes required to fill
buf
. Read moresourcefn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<()>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<()>
🔬This is a nightly-only experimental API. (
read_buf
#78485)Read the exact number of bytes required to fill
cursor
. Read moresourcefn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Creates a “by reference” adaptor for this instance of
Read
. Read more1.51.0 · sourceimpl Seek for Empty
impl Seek for Empty
sourcefn seek(&mut self, _pos: SeekFrom) -> Result<u64>
fn seek(&mut self, _pos: SeekFrom) -> Result<u64>
Seek to an offset, in bytes, in a stream. Read more
sourcefn stream_len(&mut self) -> Result<u64>
fn stream_len(&mut self) -> Result<u64>
🔬This is a nightly-only experimental API. (
seek_stream_len
#59359)Returns the length of this stream (in bytes). Read more
sourcefn stream_position(&mut self) -> Result<u64>
fn stream_position(&mut self) -> Result<u64>
Returns the current seek position from the start of the stream. Read more
impl Copy for Empty
Auto Trait Implementations
impl RefUnwindSafe for Empty
impl Send for Empty
impl Sync for Empty
impl Unpin for Empty
impl UnwindSafe for Empty
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more