pub struct Empty { /* private fields */ }
Available on crate feature
io-util
only.Expand description
An async reader which is always at EOF.
This struct is generally created by calling empty
. Please see
the documentation of empty()
for more details.
This is an asynchronous version of std::io::empty
.
Trait Implementations§
Source§impl AsyncBufRead for Empty
impl AsyncBufRead for Empty
Source§impl AsyncRead for Empty
impl AsyncRead for Empty
Source§fn poll_read(
self: Pin<&mut Self>,
_: &mut Context<'_>,
_: &mut [u8],
) -> Poll<Result<usize>>
fn poll_read( self: Pin<&mut Self>, _: &mut Context<'_>, _: &mut [u8], ) -> Poll<Result<usize>>
Source§unsafe fn prepare_uninitialized_buffer(
&self,
buf: &mut [MaybeUninit<u8>],
) -> bool
unsafe fn prepare_uninitialized_buffer( &self, buf: &mut [MaybeUninit<u8>], ) -> bool
Prepares an uninitialized buffer to be safe to pass to
read
. Returns
true
if the supplied buffer was zeroed out. Read moreAuto Trait Implementations§
impl Freeze for Empty
impl RefUnwindSafe for Empty
impl Send for Empty
impl Sync for Empty
impl Unpin for Empty
impl UnwindSafe for Empty
Blanket Implementations§
Source§impl<R> AsyncBufReadExt for Rwhere
R: AsyncBufRead + ?Sized,
impl<R> AsyncBufReadExt for Rwhere
R: AsyncBufRead + ?Sized,
Source§fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntil<'a, Self>where
Self: Unpin,
fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntil<'a, Self>where
Self: Unpin,
Available on crate feature
io-util
only.Source§fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLine<'a, Self>where
Self: Unpin,
fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLine<'a, Self>where
Self: Unpin,
Available on crate feature
io-util
only.Read all bytes until a newline (the 0xA byte) is reached, and append
them to the provided buffer. Read more
Source§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
Available on crate feature
io-util
only.Pull some bytes from this source into the specified buffer,
returning how many bytes were read. Read more
Source§fn read_buf<'a, B>(&'a mut self, buf: &'a mut B) -> ReadBuf<'a, Self, B>
fn read_buf<'a, B>(&'a mut self, buf: &'a mut B) -> ReadBuf<'a, Self, B>
Available on crate feature
io-util
only.Pull some bytes from this source into the specified buffer,
advancing the buffer’s internal cursor. Read more
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
Available on crate feature
io-util
only.Read the exact number of bytes required to fill
buf
. Read moreSource§fn read_u8<'a>(&'a mut self) -> ReadU8<&'a mut Self>where
Self: Unpin,
fn read_u8<'a>(&'a mut self) -> ReadU8<&'a mut Self>where
Self: Unpin,
Available on crate feature
io-util
only.Reads an unsigned 8 bit integer from the underlying reader. Read more
Source§fn read_i8<'a>(&'a mut self) -> ReadI8<&'a mut Self>where
Self: Unpin,
fn read_i8<'a>(&'a mut self) -> ReadI8<&'a mut Self>where
Self: Unpin,
Available on crate feature
io-util
only.Reads a signed 8 bit integer from the underlying reader. Read more
Source§fn read_u16<'a>(&'a mut self) -> ReadU16<&'a mut Self>where
Self: Unpin,
fn read_u16<'a>(&'a mut self) -> ReadU16<&'a mut Self>where
Self: Unpin,
Available on crate feature
io-util
only.Reads an unsigned 16-bit integer in big-endian order from the
underlying reader. Read more
Source§fn read_i16<'a>(&'a mut self) -> ReadI16<&'a mut Self>where
Self: Unpin,
fn read_i16<'a>(&'a mut self) -> ReadI16<&'a mut Self>where
Self: Unpin,
Available on crate feature
io-util
only.Reads a signed 16-bit integer in big-endian order from the
underlying reader. Read more
Source§fn read_u32<'a>(&'a mut self) -> ReadU32<&'a mut Self>where
Self: Unpin,
fn read_u32<'a>(&'a mut self) -> ReadU32<&'a mut Self>where
Self: Unpin,
Available on crate feature
io-util
only.Reads an unsigned 32-bit integer in big-endian order from the
underlying reader. Read more
Source§fn read_i32<'a>(&'a mut self) -> ReadI32<&'a mut Self>where
Self: Unpin,
fn read_i32<'a>(&'a mut self) -> ReadI32<&'a mut Self>where
Self: Unpin,
Available on crate feature
io-util
only.Reads a signed 32-bit integer in big-endian order from the
underlying reader. Read more
Source§fn read_u64<'a>(&'a mut self) -> ReadU64<&'a mut Self>where
Self: Unpin,
fn read_u64<'a>(&'a mut self) -> ReadU64<&'a mut Self>where
Self: Unpin,
Available on crate feature
io-util
only.Reads an unsigned 64-bit integer in big-endian order from the
underlying reader. Read more
Source§fn read_i64<'a>(&'a mut self) -> ReadI64<&'a mut Self>where
Self: Unpin,
fn read_i64<'a>(&'a mut self) -> ReadI64<&'a mut Self>where
Self: Unpin,
Available on crate feature
io-util
only.Reads an signed 64-bit integer in big-endian order from the
underlying reader. Read more
Source§fn read_u128<'a>(&'a mut self) -> ReadU128<&'a mut Self>where
Self: Unpin,
fn read_u128<'a>(&'a mut self) -> ReadU128<&'a mut Self>where
Self: Unpin,
Available on crate feature
io-util
only.Reads an unsigned 128-bit integer in big-endian order from the
underlying reader. Read more
Source§fn read_i128<'a>(&'a mut self) -> ReadI128<&'a mut Self>where
Self: Unpin,
fn read_i128<'a>(&'a mut self) -> ReadI128<&'a mut Self>where
Self: Unpin,
Available on crate feature
io-util
only.Reads an signed 128-bit integer in big-endian order from the
underlying reader. Read more
Source§fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
Available on crate feature
io-util
only.Read all bytes until EOF in this source, placing them into
buf
. Read moreSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more