[][src]Struct arrow::array::StructBuilder

pub struct StructBuilder { /* fields omitted */ }

Array builder for Struct types.

Note that callers should make sure that methods of all the child field builders are properly called to maintain the consistency of the data structure.

Implementations

impl StructBuilder[src]

pub fn new(fields: Vec<Field>, builders: Vec<Box<dyn ArrayBuilder>>) -> Self[src]

pub fn from_schema(schema: Schema, capacity: usize) -> Self[src]

pub fn field_builder<T: ArrayBuilder>(&mut self, i: usize) -> Option<&mut T>[src]

Returns a mutable reference to the child field builder at index i. Result will be None if the input type T provided doesn't match the actual field builder's type.

pub fn num_fields(&self) -> usize[src]

Returns the number of fields for the struct this builder is building.

pub fn append(&mut self, is_valid: bool) -> Result<()>[src]

Appends an element (either null or non-null) to the struct. The actual elements should be appended for each child sub-array in a consistent way.

pub fn append_null(&mut self) -> Result<()>[src]

Appends a null element to the struct.

pub fn finish(&mut self) -> StructArray[src]

Builds the StructArray and reset this builder.

Trait Implementations

impl ArrayBuilder for StructBuilder[src]

fn len(&self) -> usize[src]

Returns the number of array slots in the builder.

Note that this always return the first child field builder's length, and it is the caller's responsibility to maintain the consistency that all the child field builder should have the equal number of elements.

fn is_empty(&self) -> bool[src]

Returns whether the number of array slots is zero

fn append_data(&mut self, data: &[ArrayDataRef]) -> Result<()>[src]

Appends data from other arrays into the builder

This is most useful when concatenating arrays of the same type into a builder.

fn data_type(&self) -> DataType[src]

Returns the data type of the builder

This is used for validating array data types in append_data

fn finish(&mut self) -> ArrayRef[src]

Builds the array.

fn as_any(&self) -> &dyn Any[src]

Returns the builder as a non-mutable Any reference.

This is most useful when one wants to call non-mutable APIs on a specific builder type. In this case, one can first cast this into a Any, and then use downcast_ref to get a reference on the specific builder.

fn as_any_mut(&mut self) -> &mut dyn Any[src]

Returns the builder as a mutable Any reference.

This is most useful when one wants to call mutable APIs on a specific builder type. In this case, one can first cast this into a Any, and then use downcast_mut to get a reference on the specific builder.

fn into_box_any(self: Box<Self>) -> Box<dyn Any>[src]

Returns the boxed builder as a box of Any.

impl Debug for StructBuilder[src]

impl Drop for StructBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]