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(
dtype: ArrowDataType,
length: usize,
values: Box<dyn Array>,
validity: Option<Bitmap>,
) -> PolarsResult<Self>
pub fn try_new( dtype: ArrowDataType, length: usize, values: Box<dyn Array>, validity: Option<Bitmap>, ) -> PolarsResult<Self>
Creates a new FixedSizeListArray
.
§Errors
This function returns an error iff:
- The
dtype
’s physical type is notcrate::datatypes::PhysicalType::FixedSizeList
- The
dtype
’s inner field’s data type is not equal tovalues.dtype
. - The length of
values
is not a multiple ofsize
indtype
- the validity’s length is not equal to
values.len() / size
.
Sourcepub fn new(
dtype: ArrowDataType,
length: usize,
values: Box<dyn Array>,
validity: Option<Bitmap>,
) -> Self
pub fn new( dtype: ArrowDataType, length: usize, 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(dtype: ArrowDataType) -> Self
pub fn new_empty(dtype: ArrowDataType) -> Self
Returns a new empty FixedSizeListArray
.
Sourcepub fn new_null(dtype: ArrowDataType, length: usize) -> Self
pub fn new_null(dtype: ArrowDataType, length: usize) -> Self
Returns a new null FixedSizeListArray
.
pub fn from_shape( leaf_array: ArrayRef, dimensions: &[ReshapeDimension], ) -> PolarsResult<ArrayRef>
pub fn get_dims(&self) -> Vec<Dimension>
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(dtype: ArrowDataType, size: usize) -> ArrowDataType
pub fn default_datatype(dtype: 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 dtype(&self) -> &ArrowDataType
fn dtype(&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)
fn has_nulls(&self) -> bool
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 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
Source§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§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§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