pub struct StructReader { /* private fields */ }Expand description
A batched reader for STRUCT input vectors.
Pre-creates a VectorReader for every field at construction, allowing
direct typed reads without repeated duckdb_struct_vector_get_child calls.
Implementations§
Source§impl StructReader
impl StructReader
Sourcepub unsafe fn new(
vector: duckdb_vector,
field_count: usize,
row_count: usize,
) -> Self
pub unsafe fn new( vector: duckdb_vector, field_count: usize, row_count: usize, ) -> Self
Creates a new StructReader for a STRUCT vector with field_count fields.
§Safety
vectormust be a validDuckDBSTRUCT vector.field_countmust match the number of fields in the STRUCT type.row_countmust match the number of rows in the parent chunk.- The vector must remain valid for the lifetime of this reader.
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Returns the number of fields in this struct reader.
Sourcepub fn field(&self, field_idx: usize) -> &VectorReader
pub fn field(&self, field_idx: usize) -> &VectorReader
Returns a reference to the VectorReader for the given field.
§Panics
Panics if field_idx >= field_count.
Sourcepub unsafe fn read_interval(&self, row: usize, field_idx: usize) -> DuckInterval
pub unsafe fn read_interval(&self, row: usize, field_idx: usize) -> DuckInterval
Sourcepub unsafe fn read_timestamp(&self, row: usize, field_idx: usize) -> i64
pub unsafe fn read_timestamp(&self, row: usize, field_idx: usize) -> i64
Auto Trait Implementations§
impl Freeze for StructReader
impl RefUnwindSafe for StructReader
impl !Send for StructReader
impl !Sync for StructReader
impl Unpin for StructReader
impl UnsafeUnpin for StructReader
impl UnwindSafe for StructReader
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