pub trait QuoteClassifiedIterator<'i, I: InputBlockIterator<'i, N>, M, const N: usize>: FallibleIterator<Item = QuoteClassifiedBlock<I::Block, M, N>, Error = InputError> {
// Required methods
fn get_offset(&self) -> usize;
fn offset(&mut self, count: isize) -> QuoteIterResult<I::Block, M, N>;
fn flip_quotes_bit(&mut self);
}
Expand description
Trait for quote classifier iterators, i.e. finite iterators
enriching blocks of input with quote bitmasks.
Iterator is allowed to hold a reference to the JSON document valid for 'a
.
Required Methods§
Sourcefn get_offset(&self) -> usize
fn get_offset(&self) -> usize
Get the total offset in bytes from the beginning of input.
Sourcefn offset(&mut self, count: isize) -> QuoteIterResult<I::Block, M, N>
fn offset(&mut self, count: isize) -> QuoteIterResult<I::Block, M, N>
Move the iterator count
blocks forward.
§Errors
At least one new block is read from the underlying
InputBlockIterator
implementation, which can fail.
Sourcefn flip_quotes_bit(&mut self)
fn flip_quotes_bit(&mut self)
Flip the bit representing whether the last block ended with a nonescaped quote.
This should be done only in very specific circumstances where the previous-block state could have been damaged due to stopping and resuming the classification at a later point.