Struct polars_arrow::array::MutableListArray
source · pub struct MutableListArray<O: Offset, M: MutableArray> { /* private fields */ }
Expand description
The mutable version of ListArray
.
Implementations§
source§impl<O: Offset, M: MutableArray + Default> MutableListArray<O, M>
impl<O: Offset, M: MutableArray + Default> MutableListArray<O, M>
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new empty MutableListArray
.
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new MutableListArray
with a capacity.
source§impl<O: Offset, M: MutableArray> MutableListArray<O, M>
impl<O: Offset, M: MutableArray> MutableListArray<O, M>
sourcepub fn new_from(values: M, data_type: ArrowDataType, capacity: usize) -> Self
pub fn new_from(values: M, data_type: ArrowDataType, capacity: usize) -> Self
Creates a new MutableListArray
from a MutableArray
and capacity.
sourcepub fn new_with_field(values: M, name: &str, nullable: bool) -> Self
pub fn new_with_field(values: M, name: &str, nullable: bool) -> Self
Creates a new MutableListArray
from a MutableArray
.
sourcepub fn new_with_capacity(values: M, capacity: usize) -> Self
pub fn new_with_capacity(values: M, capacity: usize) -> Self
Creates a new MutableListArray
from a MutableArray
and capacity.
sourcepub fn new_from_mutable(
values: M,
offsets: Offsets<O>,
validity: Option<MutableBitmap>
) -> Self
pub fn new_from_mutable( values: M, offsets: Offsets<O>, validity: Option<MutableBitmap> ) -> Self
Creates a new MutableListArray
from a MutableArray
, Offsets
and
MutableBitmap
.
sourcepub fn try_push_valid(&mut self) -> PolarsResult<()>
pub fn try_push_valid(&mut self) -> PolarsResult<()>
Needs to be called when a valid value was extended to this array.
This is a relatively low level function, prefer try_push
when you can.
sourcepub fn try_extend_from_lengths<II>(&mut self, iterator: II) -> PolarsResult<()>
pub fn try_extend_from_lengths<II>(&mut self, iterator: II) -> PolarsResult<()>
Expand this array, using elements from the underlying backing array.
Assumes the expansion begins at the highest previous offset, or zero if
this MutableListArray
is currently empty.
Panics if:
- the new offsets are not in monotonic increasing order.
- any new offset is not in bounds of the backing array.
- the passed iterator has no upper bound.
sourcepub fn mut_values(&mut self) -> &mut M
pub fn mut_values(&mut self) -> &mut M
The values
sourcepub fn into_box(self) -> Box<dyn Array>
pub fn into_box(self) -> Box<dyn Array>
converts itself into Box<dyn Array>
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the MutableListArray
to fit its current length.
Trait Implementations§
source§impl<O: Clone + Offset, M: Clone + MutableArray> Clone for MutableListArray<O, M>
impl<O: Clone + Offset, M: Clone + MutableArray> Clone for MutableListArray<O, M>
source§fn clone(&self) -> MutableListArray<O, M>
fn clone(&self) -> MutableListArray<O, M>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<O: Debug + Offset, M: Debug + MutableArray> Debug for MutableListArray<O, M>
impl<O: Debug + Offset, M: Debug + MutableArray> Debug for MutableListArray<O, M>
source§impl<O: Offset, M: MutableArray + Default> Default for MutableListArray<O, M>
impl<O: Offset, M: MutableArray + Default> Default for MutableListArray<O, M>
source§impl<O: Offset, M: MutableArray> From<MutableListArray<O, M>> for ListArray<O>
impl<O: Offset, M: MutableArray> From<MutableListArray<O, M>> for ListArray<O>
source§fn from(other: MutableListArray<O, M>) -> Self
fn from(other: MutableListArray<O, M>) -> Self
source§impl<O: Offset, M: MutableArray + 'static> MutableArray for MutableListArray<O, M>
impl<O: Offset, M: MutableArray + 'static> MutableArray for MutableListArray<O, M>
source§fn validity(&self) -> Option<&MutableBitmap>
fn validity(&self) -> Option<&MutableBitmap>
source§fn as_arc(&mut self) -> Arc<dyn Array>
fn as_arc(&mut self) -> Arc<dyn Array>
Array
.source§fn data_type(&self) -> &ArrowDataType
fn data_type(&self) -> &ArrowDataType
ArrowDataType
of the array.source§fn as_mut_any(&mut self) -> &mut dyn Any
fn as_mut_any(&mut self) -> &mut dyn Any
Any
, to enable dynamic casting.source§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
source§impl<O, M, I, T> TryExtend<Option<I>> for MutableListArray<O, M>
impl<O, M, I, T> TryExtend<Option<I>> for MutableListArray<O, M>
source§fn try_extend<II: IntoIterator<Item = Option<I>>>(
&mut self,
iter: II
) -> PolarsResult<()>
fn try_extend<II: IntoIterator<Item = Option<I>>>( &mut self, iter: II ) -> PolarsResult<()>
Extend::extend
.source§impl<O, M> TryExtendFromSelf for MutableListArray<O, M>
impl<O, M> TryExtendFromSelf for MutableListArray<O, M>
source§fn try_extend_from_self(&mut self, other: &Self) -> PolarsResult<()>
fn try_extend_from_self(&mut self, other: &Self) -> PolarsResult<()>
other
, failing only on overflow.