pub(crate) struct StructArrayBuilder {
fields: Vec<FieldRef>,
arrays: Vec<ArrayRef>,
nulls: Option<NullBuffer>,
}Expand description
Builds struct arrays from component fields
TODO: move to arrow crate
Fields§
§fields: Vec<FieldRef>§arrays: Vec<ArrayRef>§nulls: Option<NullBuffer>Implementations§
Source§impl StructArrayBuilder
impl StructArrayBuilder
pub fn new() -> Self
Sourcepub fn with_field(
self,
field_name: &str,
array: ArrayRef,
nullable: bool,
) -> Self
pub fn with_field( self, field_name: &str, array: ArrayRef, nullable: bool, ) -> Self
Add an array to this struct array as a field with the specified name.
Sourcepub fn with_field_ref(self, field: FieldRef, array: ArrayRef) -> Self
pub fn with_field_ref(self, field: FieldRef, array: ArrayRef) -> Self
Add an array to this struct array using a caller-supplied [FieldRef].
Use this when the field carries metadata (e.g. an extension type) that would be lost if the field were synthesized from the array’s data type alone.
Sourcepub fn with_nulls(self, nulls: NullBuffer) -> Self
pub fn with_nulls(self, nulls: NullBuffer) -> Self
Set the null buffer for this struct array.
pub fn build(self) -> StructArray
Trait Implementations§
Source§impl Clone for StructArrayBuilder
impl Clone for StructArrayBuilder
Source§fn clone(&self) -> StructArrayBuilder
fn clone(&self) -> StructArrayBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StructArrayBuilder
impl Debug for StructArrayBuilder
Source§impl Default for StructArrayBuilder
impl Default for StructArrayBuilder
Source§fn default() -> StructArrayBuilder
fn default() -> StructArrayBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for StructArrayBuilder
impl !UnwindSafe for StructArrayBuilder
impl Freeze for StructArrayBuilder
impl Send for StructArrayBuilder
impl Sync for StructArrayBuilder
impl Unpin for StructArrayBuilder
impl UnsafeUnpin for StructArrayBuilder
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