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
sourceimpl<'a> FixedSizeListArray
impl<'a> FixedSizeListArray
sourcepub fn iter(
&'a self
) -> ZipValidity<'a, Box<dyn Array>, ListValuesIter<'a, FixedSizeListArray>>ⓘNotable traits for ZipValidity<'a, T, I>impl<'a, T, I: Iterator<Item = T>> Iterator for ZipValidity<'a, T, I> type Item = Option<T>;
pub fn iter(
&'a self
) -> ZipValidity<'a, Box<dyn Array>, ListValuesIter<'a, FixedSizeListArray>>ⓘNotable traits for ZipValidity<'a, T, I>impl<'a, T, I: Iterator<Item = T>> Iterator for ZipValidity<'a, T, I> type Item = Option<T>;
Returns an iterator of Option<Box<dyn Array>>
sourcepub fn values_iter(&'a self) -> ListValuesIter<'a, FixedSizeListArray>ⓘNotable traits for ListValuesIter<'a, A>impl<'a, A: IterableListArray> Iterator for ListValuesIter<'a, A> type Item = Box<dyn Array>;
pub fn values_iter(&'a self) -> ListValuesIter<'a, FixedSizeListArray>ⓘNotable traits for ListValuesIter<'a, A>impl<'a, A: IterableListArray> Iterator for ListValuesIter<'a, A> type Item = Box<dyn Array>;
Returns an iterator of Box<dyn Array>
sourceimpl FixedSizeListArray
impl FixedSizeListArray
sourcepub fn try_new(
data_type: DataType,
values: Arc<dyn Array>,
validity: Option<Bitmap>
) -> Result<Self, ArrowError>
pub fn try_new(
data_type: DataType,
values: Arc<dyn Array>,
validity: Option<Bitmap>
) -> Result<Self, ArrowError>
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: Arc<dyn Array>,
validity: Option<Bitmap>
) -> Self
pub fn new(
data_type: DataType,
values: Arc<dyn Array>,
validity: Option<Bitmap>
) -> Self
Creates a new FixedSizeListArray
.
Panics
This function panics 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 from_data(
data_type: DataType,
values: Arc<dyn Array>,
validity: Option<Bitmap>
) -> Self
pub fn from_data(
data_type: DataType,
values: Arc<dyn Array>,
validity: Option<Bitmap>
) -> Self
Alias for new
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
.
sourceimpl 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
Sets the validity bitmap on this FixedSizeListArray
.
Panic
This function panics iff validity.len() != self.len()
.
sourceimpl 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
sourceimpl Array for FixedSizeListArray
impl Array for FixedSizeListArray
sourcefn data_type(&self) -> &DataType
fn data_type(&self) -> &DataType
The DataType
of the Array
. In combination with Array::as_any
, this can be
used to downcast trait objects (dyn Array
) to concrete arrays. Read more
sourcefn null_count(&self) -> usize
fn null_count(&self) -> usize
sourceimpl Clone for FixedSizeListArray
impl Clone for FixedSizeListArray
sourcefn clone(&self) -> FixedSizeListArray
fn clone(&self) -> FixedSizeListArray
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FixedSizeListArray
impl Debug for FixedSizeListArray
sourceimpl<'a> From<GrowableFixedSizeList<'a>> for FixedSizeListArray
impl<'a> From<GrowableFixedSizeList<'a>> for FixedSizeListArray
sourcefn from(val: GrowableFixedSizeList<'a>) -> Self
fn from(val: GrowableFixedSizeList<'a>) -> Self
Performs the conversion.
sourceimpl<M: MutableArray> From<MutableFixedSizeListArray<M>> for FixedSizeListArray
impl<M: MutableArray> From<MutableFixedSizeListArray<M>> for FixedSizeListArray
sourcefn from(other: MutableFixedSizeListArray<M>) -> Self
fn from(other: MutableFixedSizeListArray<M>) -> Self
Performs the conversion.
sourceimpl<'a> IntoIterator for &'a FixedSizeListArray
impl<'a> IntoIterator for &'a FixedSizeListArray
type IntoIter = ZipValidity<'a, Box<dyn Array>, ListValuesIter<'a, FixedSizeListArray>>
type IntoIter = ZipValidity<'a, Box<dyn Array>, ListValuesIter<'a, FixedSizeListArray>>
Which kind of iterator are we turning this into?
sourceimpl PartialEq<&'_ (dyn Array + '_)> for FixedSizeListArray
impl PartialEq<&'_ (dyn Array + '_)> for FixedSizeListArray
Auto Trait Implementations
impl !RefUnwindSafe for FixedSizeListArray
impl Send for FixedSizeListArray
impl Sync for FixedSizeListArray
impl Unpin for FixedSizeListArray
impl !UnwindSafe for FixedSizeListArray
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more