Trait polars_arrow::array::growable::Growable

source ·
pub trait Growable<'a> {
    // Required methods
    unsafe fn extend(&mut self, index: usize, start: usize, len: usize);
    fn extend_validity(&mut self, additional: usize);
    fn len(&self) -> usize;
    fn as_box(&mut self) -> Box<dyn Array>;

    // Provided methods
    unsafe fn extend_copies(
        &mut self,
        index: usize,
        start: usize,
        len: usize,
        copies: usize,
    ) { ... }
    fn as_arc(&mut self) -> Arc<dyn Array> { ... }
}
Expand description

Describes a struct that can be extended from slices of other pre-existing Arrays. This is used in operations where a new array is built out of other arrays, such as filter and concatenation.

Required Methods§

source

unsafe fn extend(&mut self, index: usize, start: usize, len: usize)

Extends this Growable with elements from the bounded Array at index index from a slice starting at start and length len.

§Safety

Doesn’t do any bound checks.

source

fn extend_validity(&mut self, additional: usize)

Extends this Growable with null elements, disregarding the bound arrays

§Safety

Doesn’t do any bound checks

source

fn len(&self) -> usize

The current length of the Growable.

source

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

Converts this Growable to an Box<dyn Array>, thereby finishing the mutation. Self will be empty after such operation

Provided Methods§

source

unsafe fn extend_copies( &mut self, index: usize, start: usize, len: usize, copies: usize, )

Same as extend, except it repeats the extension copies times.

§Safety

Doesn’t do any bound checks.

source

fn as_arc(&mut self) -> Arc<dyn Array>

Converts this Growable to an Arc<dyn Array>, thereby finishing the mutation. Self will be empty after such operation.

Implementors§

source§

impl<'a> Growable<'a> for GrowableBoolean<'a>

source§

impl<'a> Growable<'a> for GrowableFixedSizeBinary<'a>

source§

impl<'a> Growable<'a> for GrowableFixedSizeList<'a>

source§

impl<'a> Growable<'a> for GrowableNull

source§

impl<'a> Growable<'a> for GrowableStruct<'a>

source§

impl<'a, O: Offset> Growable<'a> for GrowableBinary<'a, O>

source§

impl<'a, O: Offset> Growable<'a> for GrowableList<'a, O>

source§

impl<'a, O: Offset> Growable<'a> for GrowableUtf8<'a, O>

source§

impl<'a, T: NativeType> Growable<'a> for GrowablePrimitive<'a, T>

source§

impl<'a, T: DictionaryKey> Growable<'a> for GrowableDictionary<'a, T>

source§

impl<'a, T: ViewType + ?Sized> Growable<'a> for GrowableBinaryViewArray<'a, T>