polars_arrow::array::growable

Trait 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 Growable<'_> for GrowableNull

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 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>