[−][src]Function tokio::io::read_exact
pub fn read_exact<A, T>(a: A, buf: T) -> ReadExact<A, T> where
A: AsyncRead,
T: AsMut<[u8]>,
Creates a future which will read exactly enough bytes to fill buf
,
returning an error if EOF is hit sooner.
The returned future will resolve to both the I/O stream as well as the buffer once the read operation is completed.
In the case of an error the buffer and the object will be discarded, with the error yielded. In the case of success the object will be destroyed and the buffer will be returned, with all data read from the stream appended to the buffer.