Struct polars_arrow::array::MapArray  
source · pub struct MapArray { /* private fields */ }Expand description
An array representing a (key, value), both of arbitrary logical types.
Implementations§
source§impl<'a> MapArray
 
impl<'a> MapArray
sourcepub fn iter(
    &'a self
) -> ZipValidity<Box<dyn Array>, MapValuesIter<'a>, BitmapIter<'a>> ⓘ
 
pub fn iter( &'a self ) -> ZipValidity<Box<dyn Array>, MapValuesIter<'a>, BitmapIter<'a>> ⓘ
Returns an iterator of Option<Box<dyn Array>>
sourcepub fn values_iter(&'a self) -> MapValuesIter<'a>
 
pub fn values_iter(&'a self) -> MapValuesIter<'a>
Returns an iterator of Box<dyn Array>
source§impl MapArray
 
impl MapArray
sourcepub fn try_new(
    data_type: ArrowDataType,
    offsets: OffsetsBuffer<i32>,
    field: Box<dyn Array>,
    validity: Option<Bitmap>
) -> PolarsResult<Self>
 
pub fn try_new( data_type: ArrowDataType, offsets: OffsetsBuffer<i32>, field: Box<dyn Array>, validity: Option<Bitmap> ) -> PolarsResult<Self>
Returns a new MapArray.
Errors
This function errors iff:
- The last offset is not equal to the field’ length
- The data_type’s physical type is notcrate::datatypes::PhysicalType::Map
- The fields’ data_typeis not equal to the inner field ofdata_type
- The validity is not Noneand its length is different fromoffsets.len() - 1.
sourcepub fn new(
    data_type: ArrowDataType,
    offsets: OffsetsBuffer<i32>,
    field: Box<dyn Array>,
    validity: Option<Bitmap>
) -> Self
 
pub fn new( data_type: ArrowDataType, offsets: OffsetsBuffer<i32>, field: Box<dyn Array>, validity: Option<Bitmap> ) -> Self
Creates a new MapArray.
Panics
- The last offset is not equal to the field’ length.
- The data_type’s physical type is notcrate::datatypes::PhysicalType::Map,
- The validity is not Noneand its length is different fromoffsets.len() - 1.
sourcepub fn new_null(data_type: ArrowDataType, length: usize) -> Self
 
pub fn new_null(data_type: ArrowDataType, length: usize) -> Self
Returns a new null MapArray of length.
sourcepub fn new_empty(data_type: ArrowDataType) -> Self
 
pub fn new_empty(data_type: ArrowDataType) -> Self
Returns a new empty MapArray.
source§impl MapArray
 
impl MapArray
sourcepub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
 
pub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
sourcepub fn sliced(self, offset: usize, length: usize) -> Self
 
pub fn sliced(self, offset: usize, length: usize) -> Self
Returns this array sliced.
Implementation
This function is O(1).
Panics
iff offset + length > self.len().
sourcepub unsafe fn sliced_unchecked(self, offset: usize, length: usize) -> Self
 
pub unsafe fn sliced_unchecked(self, offset: usize, length: usize) -> Self
Returns this array sliced.
Implementation
This function is O(1).
Safety
The caller must ensure that offset + length <= self.len().
sourcepub fn with_validity(self, validity: Option<Bitmap>) -> Self
 
pub fn with_validity(self, validity: Option<Bitmap>) -> Self
sourcepub fn set_validity(&mut self, validity: Option<Bitmap>)
 
pub fn set_validity(&mut self, validity: Option<Bitmap>)
sourcepub fn boxed(self) -> Box<dyn Array>
 
pub fn boxed(self) -> Box<dyn Array>
Boxes this array into a Box<dyn Array>.
sourcepub fn arced(self) -> Arc<dyn Array>
 
pub fn arced(self) -> Arc<dyn Array>
Arcs this array into a std::sync::Arc<dyn Array>.
Trait Implementations§
source§impl Array for MapArray
 
impl Array for MapArray
source§fn as_any(&self) -> &dyn Any
 
fn as_any(&self) -> &dyn Any
Converts itself to a reference of 
Any, which enables downcasting to concrete types.source§fn as_any_mut(&mut self) -> &mut dyn Any
 
fn as_any_mut(&mut self) -> &mut dyn Any
Converts itself to a mutable reference of 
Any, which enables mutable downcasting to concrete types.source§fn len(&self) -> usize
 
fn len(&self) -> usize
The length of the 
Array. Every array has a length corresponding to the number of
elements (slots).source§fn data_type(&self) -> &ArrowDataType
 
fn data_type(&self) -> &ArrowDataType
The 
ArrowDataType of the Array. In combination with Array::as_any, this can be
used to downcast trait objects (dyn Array) to concrete arrays.source§unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
 
unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
source§unsafe fn is_null_unchecked(&self, i: usize) -> bool
 
unsafe fn is_null_unchecked(&self, i: usize) -> bool
Returns whether slot 
i is null. Read moresource§impl Arrow2Arrow for MapArray
 
impl Arrow2Arrow for MapArray
source§impl<'a> From<GrowableMap<'a>> for MapArray
 
impl<'a> From<GrowableMap<'a>> for MapArray
source§fn from(val: GrowableMap<'a>) -> Self
 
fn from(val: GrowableMap<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> IntoIterator for &'a MapArray
 
impl<'a> IntoIterator for &'a MapArray
source§impl PartialEq<&(dyn Array + 'static)> for MapArray
 
impl PartialEq<&(dyn Array + 'static)> for MapArray
Auto Trait Implementations§
impl !RefUnwindSafe for MapArray
impl Send for MapArray
impl Sync for MapArray
impl Unpin for MapArray
impl !UnwindSafe for MapArray
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