Struct arrow2::array::BooleanArray [−][src]
pub struct BooleanArray { /* fields omitted */ }
Expand description
A BooleanArray
is arrow’s equivalent to Vec<Option<bool>>
, i.e.
an array designed for highly performant operations on optionally nullable booleans.
The size of this struct is O(1)
as all data is stored behind an Arc
.
Implementations
Creates a new BooleanArray
from an TrustedLen
of bool
.
Creates a new BooleanArray
from a slice of bool
.
Creates a BooleanArray
from an iterator of trusted length.
Use this over BooleanArray::from_trusted_len_iter
when the iterator is trusted len
but this crate does not mark it as such.
Safety
The iterator must be TrustedLen
.
I.e. that size_hint().1
correctly reports its length.
pub fn from_trusted_len_iter<I, P>(iterator: I) -> Self where
P: Borrow<bool>,
I: TrustedLen<Item = Option<P>>,
pub fn from_trusted_len_iter<I, P>(iterator: I) -> Self where
P: Borrow<bool>,
I: TrustedLen<Item = Option<P>>,
Creates a BooleanArray
from a TrustedLen
.
Creates a BooleanArray
from an falible iterator of trusted length.
Safety
The iterator must be TrustedLen
.
I.e. that size_hint().1
correctly reports its length.
pub fn try_from_trusted_len_iter<E, I, P>(iterator: I) -> Result<Self, E> where
P: Borrow<bool>,
I: TrustedLen<Item = Result<Option<P>, E>>,
pub fn try_from_trusted_len_iter<E, I, P>(iterator: I) -> Result<Self, E> where
P: Borrow<bool>,
I: TrustedLen<Item = Result<Option<P>, E>>,
Creates a BooleanArray
from a TrustedLen
.
pub fn iter(&'a self) -> ZipValidity<'a, bool, BitmapIter<'a>>ⓘ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, bool, BitmapIter<'a>>ⓘNotable traits for ZipValidity<'a, T, I>
impl<'a, T, I: Iterator<Item = T>> Iterator for ZipValidity<'a, T, I> type Item = Option<T>;
constructs a new iterator
pub fn values_iter(&'a self) -> BitmapIter<'a>ⓘNotable traits for BitmapIter<'a>
impl<'a> Iterator for BitmapIter<'a> type Item = bool;
pub fn values_iter(&'a self) -> BitmapIter<'a>ⓘNotable traits for BitmapIter<'a>
impl<'a> Iterator for BitmapIter<'a> type Item = bool;
Returns an iterator of bool
Returns a new empty BooleanArray
.
Returns a new BooleanArray
whose all slots are null / None
.
The canonical method to create a BooleanArray
out of low-end APIs.
Panics
This function panics iff:
- The validity is not
None
and its length is different fromvalues
’s length
Returns a slice of this BooleanArray
.
Implementation
This operation is O(1)
as it amounts to essentially increase two ref counts.
Panic
This function panics iff offset + length >= self.len()
.
Returns the values bitmap of this BooleanArray
.
Trait Implementations
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
Performs the conversion.
Performs the conversion.
Creates a new BooleanArray
out of a slice of Optional bool
.
Creates a value from an iterator. Read more
Auto Trait Implementations
impl RefUnwindSafe for BooleanArray
impl Send for BooleanArray
impl Sync for BooleanArray
impl Unpin for BooleanArray
impl UnwindSafe for BooleanArray
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V