Function tokio::io::read_until
source · [−]pub fn read_until<A>(a: A, byte: u8, buf: Vec<u8, Global>) -> ReadUntil<A> where
A: AsyncRead + BufRead,
Expand description
Creates a future which will read all the bytes associated with the I/O
object A
into the buffer provided until the delimiter byte
is reached.
This method is the async equivalent to BufRead::read_until
.
In 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 bytes up to, and including, the delimiter (if found).