Trait rsonpath::classification::structural::StructuralIterator
source · pub trait StructuralIterator<'i, I, Q, M, const N: usize>: FallibleIterator<Item = Structural, Error = InputError>where
I: InputBlockIterator<'i, N>,{
// Required methods
fn stop(self) -> ResumeClassifierState<'i, I, Q, M, N>;
fn resume(state: ResumeClassifierState<'i, I, Q, M, N>) -> 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);
fn turn_colons_and_commas_on(&mut self, idx: usize);
fn turn_colons_and_commas_off(&mut self);
}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§
sourcefn stop(self) -> ResumeClassifierState<'i, I, Q, M, N>
fn stop(self) -> ResumeClassifierState<'i, I, Q, M, N>
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.
sourcefn resume(state: ResumeClassifierState<'i, I, Q, M, N>) -> Self
fn resume(state: ResumeClassifierState<'i, I, Q, M, N>) -> Self
Resume classification from a state retrieved by stopping a classifier.
sourcefn turn_colons_off(&mut self)
fn turn_colons_off(&mut self)
Turn classification of Structural::Colon characters off.
sourcefn turn_colons_on(&mut self, idx: usize)
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.
sourcefn turn_commas_off(&mut self)
fn turn_commas_off(&mut self)
Turn classification of Structural::Comma characters off.
sourcefn turn_commas_on(&mut self, idx: usize)
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.
sourcefn turn_colons_and_commas_on(&mut self, idx: usize)
fn turn_colons_and_commas_on(&mut self, idx: usize)
Turn classification of both Structural::Comma and Structural::Colon
characters on. This is generally faster than calling
turn_colons_on and
turn_commas_on
in sequence.
sourcefn turn_colons_and_commas_off(&mut self)
fn turn_colons_and_commas_off(&mut self)
Turn classification of both Structural::Comma and Structural::Colon
characters off. This is generally faster than calling
turn_colons_on and
turn_commas_on
in sequence.