Trait StaticArrayBuilder

Source
pub trait StaticArrayBuilder: Send {
    type Array: Array;

    // Required methods
    fn dtype(&self) -> &ArrowDataType;
    fn reserve(&mut self, additional: usize);
    fn freeze(self) -> Self::Array;
    fn freeze_reset(&mut self) -> Self::Array;
    fn len(&self) -> usize;
    fn extend_nulls(&mut self, length: usize);
    fn subslice_extend(
        &mut self,
        other: &Self::Array,
        start: usize,
        length: usize,
        share: ShareStrategy,
    );
    fn subslice_extend_each_repeated(
        &mut self,
        other: &Self::Array,
        start: usize,
        length: usize,
        repeats: usize,
        share: ShareStrategy,
    );
    unsafe fn gather_extend(
        &mut self,
        other: &Self::Array,
        idxs: &[IdxSize],
        share: ShareStrategy,
    );
    fn opt_gather_extend(
        &mut self,
        other: &Self::Array,
        idxs: &[IdxSize],
        share: ShareStrategy,
    );

    // Provided methods
    fn extend(&mut self, other: &Self::Array, share: ShareStrategy) { ... }
    fn subslice_extend_repeated(
        &mut self,
        other: &Self::Array,
        start: usize,
        length: usize,
        repeats: usize,
        share: ShareStrategy,
    ) { ... }
}

Required Associated Types§

Required Methods§

Source

fn dtype(&self) -> &ArrowDataType

Source

fn reserve(&mut self, additional: usize)

Source

fn freeze(self) -> Self::Array

Consume this builder returning the built array.

Source

fn freeze_reset(&mut self) -> Self::Array

Return the built array and reset to an empty state.

Source

fn len(&self) -> usize

Returns the length of this builder (so far).

Source

fn extend_nulls(&mut self, length: usize)

Extend this builder with the given number of null elements.

Source

fn subslice_extend( &mut self, other: &Self::Array, start: usize, length: usize, share: ShareStrategy, )

Extends this builder with the contents of the given array subslice. May panic if other does not match the dtype of this array.

Source

fn subslice_extend_each_repeated( &mut self, other: &Self::Array, start: usize, length: usize, repeats: usize, share: ShareStrategy, )

The same as subslice_extend, but repeats each element repeats times.

Source

unsafe fn gather_extend( &mut self, other: &Self::Array, idxs: &[IdxSize], share: ShareStrategy, )

Extends this builder with the contents of the given array at the given indices. That is, other[idxs[i]] is appended to this array in order, for each i=0..idxs.len(). May panic if other does not match the dtype of this array.

§Safety

The indices must be in-bounds.

Source

fn opt_gather_extend( &mut self, other: &Self::Array, idxs: &[IdxSize], share: ShareStrategy, )

Extends this builder with the contents of the given array at the given indices. That is, other[idxs[i]] is appended to this array in order, for each i=0..idxs.len(). May panic if other does not match the dtype of this array. Out-of-bounds indices are mapped to nulls.

Provided Methods§

Source

fn extend(&mut self, other: &Self::Array, share: ShareStrategy)

Extends this builder with the contents of the given array. May panic if other does not match the dtype of this array.

Source

fn subslice_extend_repeated( &mut self, other: &Self::Array, start: usize, length: usize, repeats: usize, share: ShareStrategy, )

The same as subslice_extend, but repeats the extension repeats times.

Implementors§