Struct polars_arrow::array::MutableStructArray
source · pub struct MutableStructArray { /* private fields */ }
Expand description
Converting a MutableStructArray
into a StructArray
is O(1)
.
Implementations§
source§impl MutableStructArray
impl MutableStructArray
sourcepub fn new(data_type: ArrowDataType, values: Vec<Box<dyn MutableArray>>) -> Self
pub fn new(data_type: ArrowDataType, values: Vec<Box<dyn MutableArray>>) -> Self
Creates a new MutableStructArray
.
sourcepub fn try_new(
data_type: ArrowDataType,
values: Vec<Box<dyn MutableArray>>,
validity: Option<MutableBitmap>,
) -> PolarsResult<Self>
pub fn try_new( data_type: ArrowDataType, values: Vec<Box<dyn MutableArray>>, validity: Option<MutableBitmap>, ) -> PolarsResult<Self>
Create a MutableStructArray
out of low-end APIs.
§Errors
This function errors iff:
data_type
is notArrowDataType::Struct
- The inner types of
data_type
are not equal to those ofvalues
validity
is notNone
and its length is different from thevalues
’s length
sourcepub fn into_inner(
self,
) -> (ArrowDataType, Vec<Box<dyn MutableArray>>, Option<MutableBitmap>)
pub fn into_inner( self, ) -> (ArrowDataType, Vec<Box<dyn MutableArray>>, Option<MutableBitmap>)
Extract the low-end APIs from the MutableStructArray
.
sourcepub fn mut_values(&mut self) -> &mut Vec<Box<dyn MutableArray>>
pub fn mut_values(&mut self) -> &mut Vec<Box<dyn MutableArray>>
The mutable values
sourcepub fn values(&self) -> &Vec<Box<dyn MutableArray>>
pub fn values(&self) -> &Vec<Box<dyn MutableArray>>
The values
source§impl MutableStructArray
impl MutableStructArray
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the MutableStructArray
to fit its current length.
Trait Implementations§
source§impl Debug for MutableStructArray
impl Debug for MutableStructArray
source§impl From<MutableStructArray> for StructArray
impl From<MutableStructArray> for StructArray
source§fn from(other: MutableStructArray) -> Self
fn from(other: MutableStructArray) -> Self
Converts to this type from the input type.
source§impl MutableArray for MutableStructArray
impl MutableArray for MutableStructArray
source§fn validity(&self) -> Option<&MutableBitmap>
fn validity(&self) -> Option<&MutableBitmap>
The optional validity of the array.
source§fn as_arc(&mut self) -> Arc<dyn Array>
fn as_arc(&mut self) -> Arc<dyn Array>
Convert itself to an (immutable) atomically reference counted
Array
.source§fn data_type(&self) -> &ArrowDataType
fn data_type(&self) -> &ArrowDataType
The
ArrowDataType
of the array.source§fn as_mut_any(&mut self) -> &mut dyn Any
fn as_mut_any(&mut self) -> &mut dyn Any
Convert to mutable
Any
, to enable dynamic casting.source§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
Shrink the array to fit its length.
Auto Trait Implementations§
impl Freeze for MutableStructArray
impl !RefUnwindSafe for MutableStructArray
impl Send for MutableStructArray
impl Sync for MutableStructArray
impl Unpin for MutableStructArray
impl !UnwindSafe for MutableStructArray
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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