Function tokio_io_utility::read_to_vec_rng
source · pub fn read_to_vec_rng<'a, T: AsyncRead + ?Sized + Unpin>(
reader: &'a mut T,
vec: &'a mut Vec<u8>,
rng: impl RangeBounds<usize>
) -> ReadToVecRngFuture<'a, T> ⓘ
Expand description
rng
- The start of the range specify the minimum of bytes to read in, while the end of the range specify the maximum of bytes that can be read in. If the lower bound is not specified, it is default to 0. If the upper bound is not specified, it is default to the capacity ofbytes
. The lower bound must not be larger than the upper bound.
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.