Function tokio::io::util::read::read

source ·
pub(crate) fn read<'a, R>(reader: &'a mut R, buf: &'a mut [u8]) -> Read<'a, R> 
where R: AsyncRead + Unpin + ?Sized,
Expand description

Tries to read some bytes directly into the given buf in asynchronous manner, returning a future type.

The returned future will resolve to both the I/O stream and the buffer as well as the number of bytes read once the read operation is completed.