Closed kbleeke closed 3 years ago
Hm, I had to look twice to make sure I understand this part of the code.
I think the documentation is wrong here: consume
does not refill the buffer, but will shift it if necessary (done by the inner circular
buffer: https://docs.rs/circular/0.3.0/circular/struct.Buffer.html#method.consume). I don't think a refill would be wise, because it would cause multiple partial reads (and would prevent the crate user to control when reads are done).
I'll update the documentation.
edit: typos
The documentation here says that calls to
consume
also refill the buffer, if necessary. However, the implementation inPcapNGReader
does not do so and only refill on explicit calls torefill
. Neither does the legacy implementation.I assume this is a docs issue because refilling is fallible but
consume
does not return aResult
?