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, dtype: ArrowDataType, capacity: usize) -> Self
pub fn new_from(values: M, dtype: ArrowDataType, capacity: usize) -> Self
Creates a new MutableListArray
from a MutableArray
and capacity.
Sourcepub fn new_with_field(values: M, name: PlSmallStr, nullable: bool) -> Self
pub fn new_with_field(values: M, name: PlSmallStr, 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 dtype(&self) -> &ArrowDataType
fn dtype(&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.Source§impl<O, M, I, T> TryPush<Option<I>> for MutableListArray<O, M>
impl<O, M, I, T> TryPush<Option<I>> for MutableListArray<O, M>
Auto Trait Implementations§
impl<O, M> Freeze for MutableListArray<O, M>where
M: Freeze,
impl<O, M> RefUnwindSafe for MutableListArray<O, M>where
M: RefUnwindSafe,
impl<O, M> Send for MutableListArray<O, M>
impl<O, M> Sync for MutableListArray<O, M>
impl<O, M> Unpin for MutableListArray<O, M>
impl<O, M> UnwindSafe for MutableListArray<O, M>where
M: UnwindSafe,
O: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more