Struct arrow2::array::FixedSizeListArray
source · pub struct FixedSizeListArray { /* private fields */ }
Expand description
The Arrow’s equivalent to an immutable Vec<Option<[T; size]>>
where T
is an Arrow type.
Cloning and slicing this struct is O(1)
.
Implementations§
source§impl<'a> FixedSizeListArray
impl<'a> FixedSizeListArray
sourcepub fn iter(
&'a self
) -> ZipValidity<Box<dyn Array>, ArrayValuesIter<'a, FixedSizeListArray>, BitmapIter<'a>> ⓘ
pub fn iter( &'a self ) -> ZipValidity<Box<dyn Array>, ArrayValuesIter<'a, FixedSizeListArray>, BitmapIter<'a>> ⓘ
Returns an iterator of Option<Box<dyn Array>>
sourcepub fn values_iter(&'a self) -> ArrayValuesIter<'a, FixedSizeListArray> ⓘ
pub fn values_iter(&'a self) -> ArrayValuesIter<'a, FixedSizeListArray> ⓘ
Returns an iterator of Box<dyn Array>
source§impl FixedSizeListArray
impl FixedSizeListArray
sourcepub fn try_new(
data_type: DataType,
values: Box<dyn Array>,
validity: Option<Bitmap>
) -> Result<Self, Error>
pub fn try_new( data_type: DataType, values: Box<dyn Array>, validity: Option<Bitmap> ) -> Result<Self, Error>
Creates a new FixedSizeListArray
.
§Errors
This function returns an error iff:
- The
data_type
’s physical type is notcrate::datatypes::PhysicalType::FixedSizeList
- The
data_type
’s inner field’s data type is not equal tovalues.data_type
. - The length of
values
is not a multiple ofsize
indata_type
- the validity’s length is not equal to
values.len() / size
.
sourcepub fn new(
data_type: DataType,
values: Box<dyn Array>,
validity: Option<Bitmap>
) -> Self
pub fn new( data_type: DataType, values: Box<dyn Array>, validity: Option<Bitmap> ) -> Self
Alias to Self::try_new(...).unwrap()
sourcepub const fn size(&self) -> usize
pub const fn size(&self) -> usize
Returns the size (number of elements per slot) of this FixedSizeListArray
.
sourcepub fn new_empty(data_type: DataType) -> Self
pub fn new_empty(data_type: DataType) -> Self
Returns a new empty FixedSizeListArray
.
sourcepub fn new_null(data_type: DataType, length: usize) -> Self
pub fn new_null(data_type: DataType, length: usize) -> Self
Returns a new null FixedSizeListArray
.
sourcepub fn boxed(self) -> Box<dyn Array>
pub fn boxed(self) -> Box<dyn Array>
Boxes self into a Box<dyn Array>
.
sourcepub fn arced(self) -> Arc<dyn Array>
pub fn arced(self) -> Arc<dyn Array>
Boxes self into a Arc<dyn Array>
.
source§impl FixedSizeListArray
impl FixedSizeListArray
sourcepub fn slice(&self, offset: usize, length: usize) -> Self
pub fn slice(&self, offset: usize, length: usize) -> Self
Returns a slice of this FixedSizeListArray
.
§Implementation
This operation is O(1)
.
§Panics
panics iff offset + length > self.len()
sourcepub unsafe fn slice_unchecked(&self, offset: usize, length: usize) -> Self
pub unsafe fn slice_unchecked(&self, offset: usize, length: usize) -> Self
Returns a slice of this FixedSizeListArray
.
§Implementation
This operation 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
Returns this FixedSizeListArray
with a new validity.
§Panic
This function panics iff validity.len() != self.len()
.
sourcepub fn set_validity(&mut self, validity: Option<Bitmap>)
pub fn set_validity(&mut self, validity: Option<Bitmap>)
Sets the validity of this FixedSizeListArray
.
§Panics
This function panics iff validity.len() != self.len()
.
source§impl FixedSizeListArray
impl FixedSizeListArray
sourcepub fn default_datatype(data_type: DataType, size: usize) -> DataType
pub fn default_datatype(data_type: DataType, size: usize) -> DataType
Returns a DataType
consistent with FixedSizeListArray
.
Trait Implementations§
source§impl Array for FixedSizeListArray
impl Array for FixedSizeListArray
source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
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
Any
, which enables mutable downcasting to concrete types.source§fn len(&self) -> usize
fn len(&self) -> usize
Array
. Every array has a length corresponding to the number of
elements (slots).source§fn data_type(&self) -> &DataType
fn data_type(&self) -> &DataType
DataType
of the Array
. In combination with Array::as_any
, this can be
used to downcast trait objects (dyn Array
) to concrete arrays.source§impl Clone for FixedSizeListArray
impl Clone for FixedSizeListArray
source§fn clone(&self) -> FixedSizeListArray
fn clone(&self) -> FixedSizeListArray
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more