Trait polars_arrow::array::MutableArray

source ·
pub trait MutableArray: Debug + Send + Sync {
    // Required methods
    fn data_type(&self) -> &ArrowDataType;
    fn len(&self) -> usize;
    fn validity(&self) -> Option<&MutableBitmap>;
    fn as_box(&mut self) -> Box<dyn Array>;
    fn as_any(&self) -> &dyn Any;
    fn as_mut_any(&mut self) -> &mut dyn Any;
    fn push_null(&mut self);
    fn reserve(&mut self, additional: usize);
    fn shrink_to_fit(&mut self);

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn as_arc(&mut self) -> Arc<dyn Array> { ... }
    fn is_valid(&self, index: usize) -> bool { ... }
}
Expand description

A trait describing a mutable array; i.e. an array whose values can be changed. Mutable arrays cannot be cloned but can be mutated in place, thereby making them useful to perform numeric operations without allocations. As in Array, concrete arrays (such as MutablePrimitiveArray) implement how they are mutated.

Required Methods§

source

fn data_type(&self) -> &ArrowDataType

The ArrowDataType of the array.

source

fn len(&self) -> usize

The length of the array.

source

fn validity(&self) -> Option<&MutableBitmap>

The optional validity of the array.

source

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

Convert itself to an (immutable) Array.

source

fn as_any(&self) -> &dyn Any

Convert to Any, to enable dynamic casting.

source

fn as_mut_any(&mut self) -> &mut dyn Any

Convert to mutable Any, to enable dynamic casting.

source

fn push_null(&mut self)

Adds a new null element to the array.

source

fn reserve(&mut self, additional: usize)

Reserves additional slots to its capacity.

source

fn shrink_to_fit(&mut self)

Shrink the array to fit its length.

Provided Methods§

source

fn is_empty(&self) -> bool

Whether the array is empty.

source

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

Convert itself to an (immutable) atomically reference counted Array.

source

fn is_valid(&self, index: usize) -> bool

Whether index is valid / set.

§Panic

Panics if index >= self.len().

Trait Implementations§

source§

impl MutableArray for Box<dyn MutableArray>

source§

fn len(&self) -> usize

The length of the array.
source§

fn validity(&self) -> Option<&MutableBitmap>

The optional validity of the array.
source§

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

Convert itself to an (immutable) Array.
source§

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

Convert itself to an (immutable) atomically reference counted Array.
source§

fn data_type(&self) -> &ArrowDataType

The ArrowDataType of the array.
source§

fn as_any(&self) -> &dyn Any

Convert to Any, to enable dynamic casting.
source§

fn as_mut_any(&mut self) -> &mut dyn Any

Convert to mutable Any, to enable dynamic casting.
source§

fn push_null(&mut self)

Adds a new null element to the array.
source§

fn shrink_to_fit(&mut self)

Shrink the array to fit its length.
source§

fn reserve(&mut self, additional: usize)

Reserves additional slots to its capacity.
source§

fn is_empty(&self) -> bool

Whether the array is empty.
source§

fn is_valid(&self, index: usize) -> bool

Whether index is valid / set. Read more

Implementations on Foreign Types§

source§

impl MutableArray for Box<dyn MutableArray>

source§

fn len(&self) -> usize

source§

fn validity(&self) -> Option<&MutableBitmap>

source§

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

source§

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

source§

fn data_type(&self) -> &ArrowDataType

source§

fn as_any(&self) -> &dyn Any

source§

fn as_mut_any(&mut self) -> &mut dyn Any

source§

fn push_null(&mut self)

source§

fn shrink_to_fit(&mut self)

source§

fn reserve(&mut self, additional: usize)

Implementors§