Struct git_packetline::StreamingPeekableIter
source · [−]pub struct StreamingPeekableIter<T> { /* private fields */ }
Expand description
Read pack lines one after another, without consuming more than needed from the underlying
Read
. Flush
lines cause the reader to stop producing lines forever,
leaving Read
at the start of whatever comes next.
This implementation tries hard not to allocate at all which leads to quite some added complexity and plenty of extra memory copies.
Implementations
Return a new instance from read
which will stop decoding packet lines when receiving one of the given delimiters
.
Modify the peek buffer, overwriting the byte at position
with the given byte to replace_with
while truncating
it to contain only bytes until the newly replaced position
.
This is useful if you would want to remove ‘special bytes’ hidden behind, say a NULL byte to disappear and allow standard line readers to read the next line as usual.
Note that position
does not include the 4 bytes prefix (they are invisible outside the reader)
Returns the packet line that stopped the iteration, or
None
if the end wasn’t reached yet, on EOF, or if fail_on_err_lines()
was true.
Reset all iteration state allowing to continue a stopped iteration that is not yet at EOF.
This can happen once a delimiter is reached.
Similar to reset()
with support to changing the delimiters
.
If value
is true
the provider will check for special ERR
packet lines and stop iteration when one is encountered.
Use [stopped_at()]
StreamingPeekableIter::stopped_at() to inspect the cause of the end of the iteration.
ne
Replace the reader used with the given read
, resetting all other iteration state as well.
Return the inner read