pub struct Iterator<'a> { /* private fields */ }Expand description
Provides access to the current JSON value during scanning.
Implementations§
Source§impl<'a> Iterator<'a>
impl<'a> Iterator<'a>
Sourcepub fn array_index(&self) -> isize
pub fn array_index(&self) -> isize
Array index of current element, or -1 if not inside an array.
Sourcepub fn value_type(&self) -> ValueType
pub fn value_type(&self) -> ValueType
The type of the current value.
Sourcepub fn value_index(&self) -> usize
pub fn value_index(&self) -> usize
Start index of the current value in the source.
Sourcepub fn value_index_end(&self) -> isize
pub fn value_index_end(&self) -> isize
End index of the current value in the source. Returns -1 for objects and arrays (end unknown during traversal).
Sourcepub fn key_index(&self) -> isize
pub fn key_index(&self) -> isize
Start index of the object member key in the source, or -1 if not a member.
Sourcepub fn key_index_end(&self) -> isize
pub fn key_index_end(&self) -> isize
End index of the object member key in the source, or -1 if not a member.
Sourcepub fn key(&self) -> &'a [u8] ⓘ
pub fn key(&self) -> &'a [u8] ⓘ
The object member key (including quotes), or empty slice if not a member.
Sourcepub fn value_str(&self) -> &'a str
pub fn value_str(&self) -> &'a str
The raw value as &str. Panics if the source is not valid UTF-8.
Sourcepub fn key_str(&self) -> &'a str
pub fn key_str(&self) -> &'a str
The object member key as &str (including quotes), or "" if not a member.
Panics if the source is not valid UTF-8.
Sourcepub fn write_pointer(&self, buf: &mut Vec<u8>)
pub fn write_pointer(&self, buf: &mut Vec<u8>)
Write the JSON Pointer into the provided buffer.