Function tokio_io_utility::read_to_vec
source · pub fn read_to_vec<'a, T: AsyncRead + ?Sized + Unpin>(
reader: &'a mut T,
vec: &'a mut Vec<u8>
) -> ReadToVecFuture<'a, T> ⓘ
Expand description
Try to fill data from reader
into the spare capacity of vec
.
It can be used to implement buffering.
Return std::io::ErrorKind::UnexpectedEof
on Eof.
NOTE that this function does not modify any existing data.
Cancel safety
It is cancel safe and dropping the returned future will not stop the wakeup from happening.