pub trait ArrayBuilder: Sized + Send + Sync + 'static {
    type Array: Array<Builder = Self>;

    fn extend_from_raw_data(
        &mut self,
        raw: &[<<Self::Array as Array>::Item as ToOwned>::Owned]
    ); fn extend_from_nulls(&mut self, count: usize); fn replace_bitmap(&mut self, valid: BitVec); fn with_capacity(capacity: usize) -> Self; fn reserve(&mut self, capacity: usize); fn push_n(&mut self, n: usize, value: Option<&<Self::Array as Array>::Item>); fn append(&mut self, other: &Self::Array); fn take(&mut self) -> Self::Array; fn new() -> Self { ... } fn push(&mut self, value: Option<&<Self::Array as Array>::Item>) { ... } fn finish(self) -> Self::Array { ... } }
Expand description

A trait over all array builders.

ArrayBuilder is a trait over all builders. You could build an array with push with the help of ArrayBuilder trait. The push function always accepts reference to an element. e.g. for PrimitiveArray, you must do builder.push(Some(&1)). For Utf8Array, you must do builder.push(Some("xxx")). Note that you don’t need to construct a String.

The associated type Array is the type of the corresponding array. It is the return type of finish.

Required Associated Types§

Corresponding Array of this builder

Required Methods§

Create a new builder with capacity.

Reserve at least capacity values.

Append a value multiple times.

Append an array to builder.

Take all elements and return a new array.

Provided Methods§

Create a new builder.

Append a value to builder.

Finish build and return a new array.

Implementors§