pub trait StructuralIterator<'a, I: QuoteClassifiedIterator<'a>>: Iterator<Item = Structural> + 'a {
    // Required methods
    fn stop(self) -> ResumeClassifierState<'a, I>;
    fn resume(state: ResumeClassifierState<'a, I>) -> Self;
    fn turn_colons_off(&mut self);
    fn turn_colons_on(&mut self, idx: usize);
    fn turn_commas_off(&mut self);
    fn turn_commas_on(&mut self, idx: usize);
}
Expand description

Trait for classifier iterators, i.e. finite iterators of Structural characters that hold a reference to the JSON document valid for 'a.

Required Methods§

source

fn stop(self) -> ResumeClassifierState<'a, I>

Stop classification and return a state object that can be used to resume a classifier from the place in which the current one was stopped.

source

fn resume(state: ResumeClassifierState<'a, I>) -> Self

Resume classification from a state retrieved by stopping a classifier.

source

fn turn_colons_off(&mut self)

Turn classification of Structural::Colon characters off.

source

fn turn_colons_on(&mut self, idx: usize)

Turn classification of Structural::Colon characters on.

The idx passed should be the index of the byte in the input from which commas are to be classified. Passing an idx that does not match the index which the internal QuoteClassifiedIterator reached may result in incorrect results.

source

fn turn_commas_off(&mut self)

Turn classification of Structural::Comma characters off.

source

fn turn_commas_on(&mut self, idx: usize)

Turn classification of Structural::Comma characters on.

The idx passed should be the index of the byte in the input from which commas are to be classified. Passing an idx that does not match the index which the internal QuoteClassifiedIterator reached may result in incorrect results.

Implementors§