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

pub struct StructBuilder { /* fields omitted */ }
Expand description

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>,
    field_builders: Vec<Box<dyn ArrayBuilder>>
) -> Self
[src]

pub fn from_fields(fields: Vec<Field>, 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 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]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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

pub fn vzip(self) -> V