Struct polars_arrow::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: ArrowDataType,
values: Box<dyn Array>,
validity: Option<Bitmap>,
) -> PolarsResult<Self>
pub fn try_new( data_type: ArrowDataType, values: Box<dyn Array>, validity: Option<Bitmap>, ) -> PolarsResult<Self>
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: ArrowDataType,
values: Box<dyn Array>,
validity: Option<Bitmap>,
) -> Self
pub fn new( data_type: ArrowDataType, 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: ArrowDataType) -> Self
pub fn new_empty(data_type: ArrowDataType) -> Self
Returns a new empty FixedSizeListArray
.
sourcepub fn new_null(data_type: ArrowDataType, length: usize) -> Self
pub fn new_null(data_type: ArrowDataType, length: usize) -> Self
Returns a new null FixedSizeListArray
.
source§impl FixedSizeListArray
impl FixedSizeListArray
sourcepub fn slice(&mut self, offset: usize, length: usize)
pub fn slice(&mut self, offset: usize, length: usize)
Slices this FixedSizeListArray
.
§Implementation
This operation is O(1)
.
§Panics
panics iff offset + length > self.len()
sourcepub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
pub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
Slices this FixedSizeListArray
.
§Implementation
This operation is O(1)
.
§Safety
The caller must ensure that 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
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 take_validity(&mut self) -> Option<Bitmap>
pub fn take_validity(&mut self) -> Option<Bitmap>
Takes the validity of this array, leaving it without a validity mask.
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>
.
source§impl FixedSizeListArray
impl FixedSizeListArray
source§impl FixedSizeListArray
impl FixedSizeListArray
sourcepub fn default_datatype(data_type: ArrowDataType, size: usize) -> ArrowDataType
pub fn default_datatype(data_type: ArrowDataType, size: usize) -> ArrowDataType
Returns a ArrowDataType
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) -> &ArrowDataType
fn data_type(&self) -> &ArrowDataType
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 split_at_boxed_unchecked(
&self,
offset: usize,
) -> (Box<dyn Array>, Box<dyn Array>)
unsafe fn split_at_boxed_unchecked( &self, offset: usize, ) -> (Box<dyn Array>, Box<dyn Array>)
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
i
is null. Read moresource§impl<'a> ArrayAccessor<'a> for FixedSizeListArray
impl<'a> ArrayAccessor<'a> for FixedSizeListArray
source§impl ArrayFromIterDtype<Box<dyn Array>> for FixedSizeListArray
impl ArrayFromIterDtype<Box<dyn Array>> for FixedSizeListArray
fn arr_from_iter_with_dtype<I: IntoIterator<Item = Box<dyn Array>>>( dtype: ArrowDataType, iter: I, ) -> Self
fn try_arr_from_iter_with_dtype<E, I: IntoIterator<Item = Result<Box<dyn Array>, E>>>( dtype: ArrowDataType, iter: I, ) -> Result<Self, E>
fn arr_from_iter_trusted_with_dtype<I>(dtype: ArrowDataType, iter: I) -> Self
fn try_arr_from_iter_trusted_with_dtype<E, I>( dtype: ArrowDataType, iter: I, ) -> Result<Self, E>
source§impl ArrayFromIterDtype<Option<Box<dyn Array>>> for FixedSizeListArray
impl ArrayFromIterDtype<Option<Box<dyn Array>>> for FixedSizeListArray
fn arr_from_iter_with_dtype<I: IntoIterator<Item = Option<Box<dyn Array>>>>( dtype: ArrowDataType, iter: I, ) -> Self
fn try_arr_from_iter_with_dtype<E, I: IntoIterator<Item = Result<Option<Box<dyn Array>>, E>>>( dtype: ArrowDataType, iter: I, ) -> Result<Self, E>
fn arr_from_iter_trusted_with_dtype<I>(dtype: ArrowDataType, iter: I) -> Self
fn try_arr_from_iter_trusted_with_dtype<E, I>( dtype: ArrowDataType, iter: I, ) -> Result<Self, E>
source§impl Arrow2Arrow for FixedSizeListArray
impl Arrow2Arrow for FixedSizeListArray
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 moresource§impl Debug for FixedSizeListArray
impl Debug for FixedSizeListArray
source§impl<'a> From<GrowableFixedSizeList<'a>> for FixedSizeListArray
impl<'a> From<GrowableFixedSizeList<'a>> for FixedSizeListArray
source§fn from(val: GrowableFixedSizeList<'a>) -> Self
fn from(val: GrowableFixedSizeList<'a>) -> Self
source§impl<M: MutableArray> From<MutableFixedSizeListArray<M>> for FixedSizeListArray
impl<M: MutableArray> From<MutableFixedSizeListArray<M>> for FixedSizeListArray
source§fn from(other: MutableFixedSizeListArray<M>) -> Self
fn from(other: MutableFixedSizeListArray<M>) -> Self
source§impl<'a> IntoIterator for &'a FixedSizeListArray
impl<'a> IntoIterator for &'a FixedSizeListArray
§type IntoIter = ZipValidity<Box<dyn Array>, ArrayValuesIter<'a, FixedSizeListArray>, BitmapIter<'a>>
type IntoIter = ZipValidity<Box<dyn Array>, ArrayValuesIter<'a, FixedSizeListArray>, BitmapIter<'a>>
source§impl PartialEq<&(dyn Array + 'static)> for FixedSizeListArray
impl PartialEq<&(dyn Array + 'static)> for FixedSizeListArray
source§impl PartialEq for FixedSizeListArray
impl PartialEq for FixedSizeListArray
source§impl Splitable for FixedSizeListArray
impl Splitable for FixedSizeListArray
fn check_bound(&self, offset: usize) -> bool
source§unsafe fn _split_at_unchecked(&self, offset: usize) -> (Self, Self)
unsafe fn _split_at_unchecked(&self, offset: usize) -> (Self, Self)
split_at_unchecked
. For any usage, prefer the using
split_at
or split_at_unchecked
. Read moresource§fn split_at(&self, offset: usize) -> (Self, Self)
fn split_at(&self, offset: usize) -> (Self, Self)
source§unsafe fn split_at_unchecked(&self, offset: usize) -> (Self, Self)
unsafe fn split_at_unchecked(&self, offset: usize) -> (Self, Self)
source§impl StaticArray for FixedSizeListArray
impl StaticArray for FixedSizeListArray
type ValueT<'a> = Box<dyn Array>
type ZeroableValueT<'a> = Option<Box<dyn Array>>
type ValueIterT<'a> = ArrayValuesIter<'a, FixedSizeListArray>
fn values_iter(&self) -> Self::ValueIterT<'_>
fn iter( &self, ) -> ZipValidity<Self::ValueT<'_>, Self::ValueIterT<'_>, BitmapIter<'_>> ⓘ
fn with_validity_typed(self, validity: Option<Bitmap>) -> Self
fn full_null(length: usize, dtype: ArrowDataType) -> Self
fn full(length: usize, value: Self::ValueT<'_>, dtype: ArrowDataType) -> Self
fn get(&self, idx: usize) -> Option<Self::ValueT<'_>>
fn last(&self) -> Option<Self::ValueT<'_>>
fn value(&self, idx: usize) -> Self::ValueT<'_>
fn as_slice(&self) -> Option<&[Self::ValueT<'_>]>
fn from_vec(v: Vec<Self::ValueT<'_>>, dtype: ArrowDataType) -> Self
fn from_zeroable_vec( v: Vec<Self::ZeroableValueT<'_>>, dtype: ArrowDataType, ) -> Self
source§impl ValueSize for FixedSizeListArray
impl ValueSize for FixedSizeListArray
source§fn get_values_size(&self) -> usize
fn get_values_size(&self) -> usize
impl ArrowArray for FixedSizeListArray
Auto Trait Implementations§
impl !Freeze for FixedSizeListArray
impl !RefUnwindSafe for FixedSizeListArray
impl Send for FixedSizeListArray
impl Sync for FixedSizeListArray
impl Unpin for FixedSizeListArray
impl !UnwindSafe for FixedSizeListArray
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default 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