pub struct Tape<'a> {
elements: &'a [TapeElement],
strings: &'a str,
string_offsets: &'a [usize],
num_rows: usize,
}
Expand description
A decoded JSON tape
String and numeric data is stored alongside an array of TapeElement
The first element is always TapeElement::Null
This approach to decoding JSON is inspired by simdjson
Fields§
§elements: &'a [TapeElement]
§strings: &'a str
§string_offsets: &'a [usize]
§num_rows: usize
Implementations§
Source§impl<'a> Tape<'a>
impl<'a> Tape<'a>
Sourcepub fn get_string(&self, idx: u32) -> &'a str
pub fn get_string(&self, idx: u32) -> &'a str
Returns the string for the given string index
Sourcepub fn get(&self, idx: u32) -> TapeElement
pub fn get(&self, idx: u32) -> TapeElement
Returns the tape element at idx
Sourcepub fn next(&self, cur_idx: u32, expected: &str) -> Result<u32, ArrowError>
pub fn next(&self, cur_idx: u32, expected: &str) -> Result<u32, ArrowError>
Returns the index of the next field at the same level as cur_idx
Return an error if cur_idx
is not the start of a field
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Tape<'a>
impl<'a> RefUnwindSafe for Tape<'a>
impl<'a> Send for Tape<'a>
impl<'a> Sync for Tape<'a>
impl<'a> Unpin for Tape<'a>
impl<'a> UnwindSafe for Tape<'a>
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