pub struct JsonTokenizer<I: Iterator<Item = u8>> { /* private fields */ }
Expand description
A pull-based tokenizer which takes an iterator over bytes and emits JsonToken
s.
Implementations§
Source§impl<I: Iterator<Item = u8>> JsonTokenizer<I>
impl<I: Iterator<Item = u8>> JsonTokenizer<I>
Sourcepub fn new(it: I) -> Self
pub fn new(it: I) -> Self
Create a new JsonTokenizer
Sourcepub fn location(&self) -> Location
pub fn location(&self) -> Location
The location after the end of the last token that was returned from next_token()
.
Sourcepub fn expect_eof(&mut self) -> Result<(), JsonParseError>
pub fn expect_eof(&mut self) -> Result<(), JsonParseError>
Returns an error if there is more than just white space in the remaining bytes.
Sourcepub fn next_token(&mut self) -> JsonParseResult<JsonToken>
pub fn next_token(&mut self) -> JsonParseResult<JsonToken>
Parses a token and returns it, or an error.
Sourcepub fn next_token_and_location(
&mut self,
) -> JsonParseResult<(JsonToken, Location)>
pub fn next_token_and_location( &mut self, ) -> JsonParseResult<(JsonToken, Location)>
Parses a token and returns it along with its location, or an error.
Auto Trait Implementations§
impl<I> Freeze for JsonTokenizer<I>where
I: Freeze,
impl<I> RefUnwindSafe for JsonTokenizer<I>where
I: RefUnwindSafe,
impl<I> Send for JsonTokenizer<I>where
I: Send,
impl<I> Sync for JsonTokenizer<I>where
I: Sync,
impl<I> Unpin for JsonTokenizer<I>where
I: Unpin,
impl<I> UnwindSafe for JsonTokenizer<I>where
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more