pub struct MapArray {
data_type: DataType,
offsets: OffsetsBuffer<i32>,
field: Box<dyn Array>,
validity: Option<Bitmap>,
}
Expand description
An array representing a (key, value), both of arbitrary logical types.
Fields§
§data_type: DataType
§offsets: OffsetsBuffer<i32>
§field: Box<dyn Array>
§validity: Option<Bitmap>
Implementations§
§impl<'a> MapArray
impl<'a> MapArray
pub fn iter(
&'a self
) -> ZipValidity<Box<dyn Array>, MapValuesIter<'a>, BitmapIter<'a>> ⓘ
pub fn iter( &'a self ) -> ZipValidity<Box<dyn Array>, MapValuesIter<'a>, BitmapIter<'a>> ⓘ
Returns an iterator of Option<Box<dyn Array>>
pub fn values_iter(&'a self) -> MapValuesIter<'a>
pub fn values_iter(&'a self) -> MapValuesIter<'a>
Returns an iterator of Box<dyn Array>
§impl MapArray
impl MapArray
pub fn try_new(
data_type: DataType,
offsets: OffsetsBuffer<i32>,
field: Box<dyn Array>,
validity: Option<Bitmap>
) -> Result<MapArray, Error>
pub fn try_new( data_type: DataType, offsets: OffsetsBuffer<i32>, field: Box<dyn Array>, validity: Option<Bitmap> ) -> Result<MapArray, Error>
Returns a new MapArray
.
§Errors
This function errors iff:
- The last offset is not equal to the field’ length
- The
data_type
’s physical type is notcrate::datatypes::PhysicalType::Map
- The fields’
data_type
is not equal to the inner field ofdata_type
- The validity is not
None
and its length is different fromoffsets.len() - 1
.
pub fn new(
data_type: DataType,
offsets: OffsetsBuffer<i32>,
field: Box<dyn Array>,
validity: Option<Bitmap>
) -> MapArray
pub fn new( data_type: DataType, offsets: OffsetsBuffer<i32>, field: Box<dyn Array>, validity: Option<Bitmap> ) -> MapArray
Creates a new MapArray
.
§Panics
- The last offset is not equal to the field’ length.
- The
data_type
’s physical type is notcrate::datatypes::PhysicalType::Map
, - The validity is not
None
and its length is different fromoffsets.len() - 1
.
§impl MapArray
impl MapArray
pub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
pub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
pub unsafe fn sliced_unchecked(self, offset: usize, length: usize) -> MapArray
pub unsafe fn sliced_unchecked(self, offset: usize, length: usize) -> MapArray
pub fn with_validity(self, validity: Option<Bitmap>) -> MapArray
pub fn with_validity(self, validity: Option<Bitmap>) -> MapArray
pub fn set_validity(&mut self, validity: Option<Bitmap>)
pub fn set_validity(&mut self, validity: Option<Bitmap>)
pub fn boxed(self) -> Box<dyn Array>
pub fn boxed(self) -> Box<dyn Array>
Boxes this array into a Box<dyn Array>
.
pub fn arced(self) -> Arc<dyn Array>
pub fn arced(self) -> Arc<dyn Array>
Arcs this array into a std::sync::Arc<dyn Array>
.
§impl MapArray
impl MapArray
pub fn offsets(&self) -> &OffsetsBuffer<i32>
pub fn offsets(&self) -> &OffsetsBuffer<i32>
returns the offsets
pub unsafe fn value_unchecked(&self, i: usize) -> Box<dyn Array>
pub unsafe fn value_unchecked(&self, i: usize) -> Box<dyn Array>
Trait Implementations§
§impl Arrow2Arrow for MapArray
impl Arrow2Arrow for MapArray
§impl Array for MapArray
impl Array for MapArray
§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.§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.§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).§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.§fn null_count(&self) -> usize
fn null_count(&self) -> usize
§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 more§impl<'a> From<GrowableMap<'a>> for MapArray
impl<'a> From<GrowableMap<'a>> for MapArray
§fn from(val: GrowableMap<'a>) -> MapArray
fn from(val: GrowableMap<'a>) -> MapArray
Converts to this type from the input type.
§impl<'a> IntoIterator for &'a MapArray
impl<'a> IntoIterator for &'a MapArray
§type IntoIter = ZipValidity<Box<dyn Array>, MapValuesIter<'a>, BitmapIter<'a>>
type IntoIter = ZipValidity<Box<dyn Array>, MapValuesIter<'a>, BitmapIter<'a>>
Which kind of iterator are we turning this into?
§impl PartialEq<&(dyn Array + 'static)> for MapArray
impl PartialEq<&(dyn Array + 'static)> for MapArray
Auto Trait Implementations§
impl Freeze for MapArray
impl !RefUnwindSafe for MapArray
impl Send for MapArray
impl Sync for MapArray
impl Unpin for MapArray
impl !UnwindSafe for MapArray
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.
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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.
§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.
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§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.