pub struct StreamingPeekableIterState<T> { /* private fields */ }Expand description
State for StreamingPeekableIter implementations.
Implementations§
Source§impl<T> StreamingPeekableIterState<T>
impl<T> StreamingPeekableIterState<T>
Sourcepub fn peek_buffer_replace_and_truncate(
&mut self,
position: usize,
replace_with: u8,
)
pub fn peek_buffer_replace_and_truncate( &mut self, position: usize, replace_with: u8, )
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)
Sourcepub fn stopped_at(&self) -> Option<PacketLineRef<'static>>
pub fn stopped_at(&self) -> Option<PacketLineRef<'static>>
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.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset all iteration state allowing to continue a stopped iteration that is not yet at EOF.
This can happen once a delimiter is reached.
Sourcepub fn reset_with(&mut self, delimiters: &'static [PacketLineRef<'static>])
pub fn reset_with(&mut self, delimiters: &'static [PacketLineRef<'static>])
Similar to reset() with support to changing the delimiters.
Sourcepub fn fail_on_err_lines(&mut self, value: bool)
pub fn fail_on_err_lines(&mut self, value: bool)
If value is true the provider will check for special ERR packet lines and stop iteration when one is encountered.
Use [stopped_at()]StreamingPeekableIterState::stopped_at() to inspect the cause of the end of the iteration.
ne