Trait ArrayBuilder

Source
pub trait ArrayBuilder: ArrayBuilderBoxedHelper + Send {
    // Required methods
    fn dtype(&self) -> &ArrowDataType;
    fn reserve(&mut self, additional: usize);
    fn freeze(self) -> Box<dyn Array>;
    fn freeze_reset(&mut self) -> Box<dyn Array>;
    fn len(&self) -> usize;
    fn extend_nulls(&mut self, length: usize);
    fn subslice_extend(
        &mut self,
        other: &dyn Array,
        start: usize,
        length: usize,
        share: ShareStrategy,
    );
    fn subslice_extend_repeated(
        &mut self,
        other: &dyn Array,
        start: usize,
        length: usize,
        repeats: usize,
        share: ShareStrategy,
    );
    fn subslice_extend_each_repeated(
        &mut self,
        other: &dyn Array,
        start: usize,
        length: usize,
        repeats: usize,
        share: ShareStrategy,
    );
    unsafe fn gather_extend(
        &mut self,
        other: &dyn Array,
        idxs: &[IdxSize],
        share: ShareStrategy,
    );
    fn opt_gather_extend(
        &mut self,
        other: &dyn Array,
        idxs: &[IdxSize],
        share: ShareStrategy,
    );

    // Provided method
    fn extend(&mut self, other: &dyn Array, share: ShareStrategy) { ... }
}

Required Methods§

Source

fn dtype(&self) -> &ArrowDataType

Source

fn reserve(&mut self, additional: usize)

Source

fn freeze(self) -> Box<dyn Array>

Consume this builder returning the built array.

Source

fn freeze_reset(&mut self) -> Box<dyn 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: &dyn 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_repeated( &mut self, other: &dyn Array, start: usize, length: usize, repeats: usize, share: ShareStrategy, )

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

Source

fn subslice_extend_each_repeated( &mut self, other: &dyn 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: &dyn 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: &dyn 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: &dyn 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.

Trait Implementations§

Source§

impl ArrayBuilder for Box<dyn ArrayBuilder>

Source§

fn dtype(&self) -> &ArrowDataType

Source§

fn reserve(&mut self, additional: usize)

Source§

fn freeze(self) -> Box<dyn Array>

Consume this builder returning the built array.
Source§

fn freeze_reset(&mut self) -> Box<dyn 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: &dyn 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_repeated( &mut self, other: &dyn Array, start: usize, length: usize, repeats: usize, share: ShareStrategy, )

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

fn subslice_extend_each_repeated( &mut self, other: &dyn 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: &dyn 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. Read more
Source§

fn opt_gather_extend( &mut self, other: &dyn 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.
Source§

fn extend(&mut self, other: &dyn 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.

Implementations on Foreign Types§

Source§

impl ArrayBuilder for Box<dyn ArrayBuilder>

Source§

fn dtype(&self) -> &ArrowDataType

Source§

fn reserve(&mut self, additional: usize)

Source§

fn freeze(self) -> Box<dyn Array>

Source§

fn freeze_reset(&mut self) -> Box<dyn Array>

Source§

fn len(&self) -> usize

Source§

fn extend_nulls(&mut self, length: usize)

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§