mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
This wraps the reader side into a BufReader and read_from_stream now reads byte-by-byte from the stream using an intermediate buffer. The BufReader doc[0] claims that using this for such reading operation is advantageous and useful for small and repeated reads to a socket. read_from_stream stops reading after reaching LF, and optionally pops CR from the back of the buffer to handle CRLF endings. [0] https://docs.rs/smol/latest/smol/io/struct.BufReader.html