pub struct ListArray<O>where
O: Offset,{ /* private fields */ }
Expand description
An Array
semantically equivalent to Vec<Option<Vec<Option<T>>>>
with Arrow’s in-memory.
Implementations§
source§impl<'a, O> ListArray<O>where
O: Offset,
impl<'a, O> ListArray<O>where
O: Offset,
sourcepub fn iter(
&'a self
) -> ZipValidity<Box<dyn Array>, ArrayValuesIter<'a, ListArray<O>>, BitmapIter<'a>> ⓘ
pub fn iter( &'a self ) -> ZipValidity<Box<dyn Array>, ArrayValuesIter<'a, ListArray<O>>, BitmapIter<'a>> ⓘ
Returns an iterator of Option<Box<dyn Array>>
sourcepub fn values_iter(&'a self) -> ArrayValuesIter<'a, ListArray<O>> ⓘ
pub fn values_iter(&'a self) -> ArrayValuesIter<'a, ListArray<O>> ⓘ
Returns an iterator of Box<dyn Array>
source§impl<O> ListArray<O>where
O: Offset,
impl<O> ListArray<O>where
O: Offset,
sourcepub fn try_new(
data_type: DataType,
offsets: OffsetsBuffer<O>,
values: Box<dyn Array>,
validity: Option<Bitmap>
) -> Result<ListArray<O>, Error>
pub fn try_new( data_type: DataType, offsets: OffsetsBuffer<O>, values: Box<dyn Array>, validity: Option<Bitmap> ) -> Result<ListArray<O>, Error>
Creates a new ListArray
.
§Errors
This function returns an error iff:
- The last offset is not equal to the values’ length.
- the validity’s length is not equal to
offsets.len()
. - The
data_type
’scrate::datatypes::PhysicalType
is not equal to eithercrate::datatypes::PhysicalType::List
orcrate::datatypes::PhysicalType::LargeList
. - The
data_type
’s inner field’s data type is not equal tovalues.data_type
.
§Implementation
This function is O(1)
sourcepub fn new(
data_type: DataType,
offsets: OffsetsBuffer<O>,
values: Box<dyn Array>,
validity: Option<Bitmap>
) -> ListArray<O>
pub fn new( data_type: DataType, offsets: OffsetsBuffer<O>, values: Box<dyn Array>, validity: Option<Bitmap> ) -> ListArray<O>
Creates a new ListArray
.
§Panics
This function panics iff:
- The last offset is not equal to the values’ length.
- the validity’s length is not equal to
offsets.len()
. - The
data_type
’scrate::datatypes::PhysicalType
is not equal to eithercrate::datatypes::PhysicalType::List
orcrate::datatypes::PhysicalType::LargeList
. - The
data_type
’s inner field’s data type is not equal tovalues.data_type
.
§Implementation
This function is O(1)
source§impl<O> ListArray<O>where
O: Offset,
impl<O> ListArray<O>where
O: Offset,
sourcepub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
pub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
sourcepub unsafe fn sliced_unchecked(
self,
offset: usize,
length: usize
) -> ListArray<O>
pub unsafe fn sliced_unchecked( self, offset: usize, length: usize ) -> ListArray<O>
sourcepub fn with_validity(self, validity: Option<Bitmap>) -> ListArray<O>
pub fn with_validity(self, validity: Option<Bitmap>) -> ListArray<O>
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>
.
source§impl<O> ListArray<O>where
O: Offset,
impl<O> ListArray<O>where
O: Offset,
source§impl<O> ListArray<O>where
O: Offset,
impl<O> ListArray<O>where
O: Offset,
sourcepub fn default_datatype(data_type: DataType) -> DataType
pub fn default_datatype(data_type: DataType) -> DataType
Returns a default DataType
: inner field is named “item” and is nullable
sourcepub fn get_child_field(data_type: &DataType) -> &Field
pub fn get_child_field(data_type: &DataType) -> &Field
Trait Implementations§
source§impl<O> Array for ListArray<O>where
O: Offset,
impl<O> Array for ListArray<O>where
O: Offset,
source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts itself to a reference of
Any
, which enables downcasting to concrete types.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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) -> &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.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<'a, O> From<GrowableList<'a, O>> for ListArray<O>where
O: Offset,
impl<'a, O> From<GrowableList<'a, O>> for ListArray<O>where
O: Offset,
source§fn from(val: GrowableList<'a, O>) -> ListArray<O>
fn from(val: GrowableList<'a, O>) -> ListArray<O>
Converts to this type from the input type.
source§impl<O, M> From<MutableListArray<O, M>> for ListArray<O>where
O: Offset,
M: MutableArray,
impl<O, M> From<MutableListArray<O, M>> for ListArray<O>where
O: Offset,
M: MutableArray,
source§fn from(other: MutableListArray<O, M>) -> ListArray<O>
fn from(other: MutableListArray<O, M>) -> ListArray<O>
Converts to this type from the input type.
source§impl<'a, O> IntoIterator for &'a ListArray<O>where
O: Offset,
impl<'a, O> IntoIterator for &'a ListArray<O>where
O: Offset,
§type IntoIter = ZipValidity<Box<dyn Array>, ArrayValuesIter<'a, ListArray<O>>, BitmapIter<'a>>
type IntoIter = ZipValidity<Box<dyn Array>, ArrayValuesIter<'a, ListArray<O>>, BitmapIter<'a>>
Which kind of iterator are we turning this into?
source§impl<O> PartialEq<&(dyn Array + 'static)> for ListArray<O>where
O: Offset,
impl<O> PartialEq<&(dyn Array + 'static)> for ListArray<O>where
O: Offset,
Auto Trait Implementations§
impl<O> Freeze for ListArray<O>
impl<O> !RefUnwindSafe for ListArray<O>
impl<O> Send for ListArray<O>
impl<O> Sync for ListArray<O>
impl<O> Unpin for ListArray<O>
impl<O> !UnwindSafe for ListArray<O>
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> ⓘ
Converts
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> ⓘ
Converts
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 moresource§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.