pub struct MutableBooleanArray { /* private fields */ }
Expand description
The Arrow’s equivalent to Vec<Option<bool>>
, but with 1/16
of its size.
Converting a MutableBooleanArray
into a BooleanArray
is O(1)
.
Implementation
This struct does not allocate a validity until one is required (i.e. push a null to it).
Implementations
sourceimpl<'a> MutableBooleanArray
impl<'a> MutableBooleanArray
sourcepub fn iter(&'a self) -> ZipValidity<'a, bool, BitmapIter<'a>>ⓘNotable traits for ZipValidity<'a, T, I>impl<'a, T, I> Iterator for ZipValidity<'a, T, I> where
I: Iterator<Item = T>, 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 for ZipValidity<'a, T, I> where
I: Iterator<Item = T>, type Item = Option<T>;
I: Iterator<Item = T>, type Item = Option<T>;
Returns an iterator over the optional values of this MutableBooleanArray
.
sourcepub 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 over the values of this MutableBooleanArray
sourceimpl MutableBooleanArray
impl MutableBooleanArray
sourcepub fn new() -> MutableBooleanArray
pub fn new() -> MutableBooleanArray
Creates an new empty MutableBooleanArray
.
sourcepub fn with_capacity(capacity: usize) -> MutableBooleanArray
pub fn with_capacity(capacity: usize) -> MutableBooleanArray
Creates an new MutableBooleanArray
with a capacity of values.
sourcepub fn from_data(
data_type: DataType,
values: MutableBitmap,
validity: Option<MutableBitmap>
) -> MutableBooleanArray
pub fn from_data(
data_type: DataType,
values: MutableBitmap,
validity: Option<MutableBitmap>
) -> MutableBooleanArray
Canonical method to create a new MutableBooleanArray
.
sourcepub fn push(&mut self, value: Option<bool>)
pub fn push(&mut self, value: Option<bool>)
Pushes a new entry to MutableBooleanArray
.
sourcepub fn extend_trusted_len_values<I>(&mut self, iterator: I) where
I: TrustedLen<Item = bool>,
pub fn extend_trusted_len_values<I>(&mut self, iterator: I) where
I: TrustedLen<Item = bool>,
Extends the MutableBooleanArray
from an iterator of values of trusted len.
This differs from extend_trusted_len
which accepts in iterator of optional values.
sourcepub unsafe fn extend_trusted_len_values_unchecked<I>(&mut self, iterator: I) where
I: Iterator<Item = bool>,
pub unsafe fn extend_trusted_len_values_unchecked<I>(&mut self, iterator: I) where
I: Iterator<Item = bool>,
Extends the MutableBooleanArray
from an iterator of values of trusted len.
This differs from extend_trusted_len_unchecked
, which accepts in iterator of optional values.
Safety
The iterator must be trusted len.
sourcepub fn extend_trusted_len<I, P>(&mut self, iterator: I) where
P: Borrow<bool>,
I: TrustedLen<Item = Option<P>>,
pub fn extend_trusted_len<I, P>(&mut self, iterator: I) where
P: Borrow<bool>,
I: TrustedLen<Item = Option<P>>,
Extends the MutableBooleanArray
from an iterator of trusted len.
sourcepub unsafe fn extend_trusted_len_unchecked<I, P>(&mut self, iterator: I) where
P: Borrow<bool>,
I: Iterator<Item = Option<P>>,
pub unsafe fn extend_trusted_len_unchecked<I, P>(&mut self, iterator: I) where
P: Borrow<bool>,
I: Iterator<Item = Option<P>>,
Extends the MutableBooleanArray
from an iterator of trusted len.
Safety
The iterator must be trusted len.
sourceimpl MutableBooleanArray
impl MutableBooleanArray
Getters
sourcepub fn values(&self) -> &MutableBitmap
pub fn values(&self) -> &MutableBitmap
Returns its values.
sourceimpl MutableBooleanArray
impl MutableBooleanArray
Setters
sourceimpl MutableBooleanArray
impl MutableBooleanArray
From implementations
sourcepub fn from_trusted_len_values_iter<I>(iterator: I) -> MutableBooleanArray where
I: TrustedLen<Item = bool>,
pub fn from_trusted_len_values_iter<I>(iterator: I) -> MutableBooleanArray where
I: TrustedLen<Item = bool>,
Creates a new MutableBooleanArray
from an TrustedLen
of bool
.
sourcepub unsafe fn from_trusted_len_values_iter_unchecked<I>(
iterator: I
) -> MutableBooleanArray where
I: Iterator<Item = bool>,
pub unsafe fn from_trusted_len_values_iter_unchecked<I>(
iterator: I
) -> MutableBooleanArray where
I: Iterator<Item = bool>,
Creates a new MutableBooleanArray
from an TrustedLen
of bool
.
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.
sourcepub fn from_slice<P>(slice: P) -> MutableBooleanArray where
P: AsRef<[bool]>,
pub fn from_slice<P>(slice: P) -> MutableBooleanArray where
P: AsRef<[bool]>,
Creates a new MutableBooleanArray
from a slice of bool
.
sourcepub unsafe fn from_trusted_len_iter_unchecked<I, P>(
iterator: I
) -> MutableBooleanArray where
P: Borrow<bool>,
I: Iterator<Item = Option<P>>,
pub unsafe fn from_trusted_len_iter_unchecked<I, P>(
iterator: I
) -> MutableBooleanArray where
P: Borrow<bool>,
I: Iterator<Item = Option<P>>,
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.
sourcepub fn from_trusted_len_iter<I, P>(iterator: I) -> MutableBooleanArray where
P: Borrow<bool>,
I: TrustedLen<Item = Option<P>>,
pub fn from_trusted_len_iter<I, P>(iterator: I) -> MutableBooleanArray where
P: Borrow<bool>,
I: TrustedLen<Item = Option<P>>,
Creates a BooleanArray
from a TrustedLen
.
sourcepub unsafe fn try_from_trusted_len_iter_unchecked<E, I, P>(
iterator: I
) -> Result<MutableBooleanArray, E> where
P: Borrow<bool>,
I: Iterator<Item = Result<Option<P>, E>>,
pub unsafe fn try_from_trusted_len_iter_unchecked<E, I, P>(
iterator: I
) -> Result<MutableBooleanArray, E> where
P: Borrow<bool>,
I: Iterator<Item = Result<Option<P>, E>>,
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.
sourcepub fn try_from_trusted_len_iter<E, I, P>(
iterator: I
) -> Result<MutableBooleanArray, 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<MutableBooleanArray, E> where
P: Borrow<bool>,
I: TrustedLen<Item = Result<Option<P>, E>>,
Creates a BooleanArray
from a TrustedLen
.
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the MutableBooleanArray
to fit its current length.
Trait Implementations
sourceimpl Debug for MutableBooleanArray
impl Debug for MutableBooleanArray
sourceimpl Default for MutableBooleanArray
impl Default for MutableBooleanArray
sourcefn default() -> MutableBooleanArray
fn default() -> MutableBooleanArray
Returns the “default value” for a type. Read more
sourceimpl Extend<Option<bool>> for MutableBooleanArray
impl Extend<Option<bool>> for MutableBooleanArray
sourcefn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Option<bool>>,
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Option<bool>>,
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl From<MutableBooleanArray> for BooleanArray
impl From<MutableBooleanArray> for BooleanArray
sourcefn from(other: MutableBooleanArray) -> BooleanArray
fn from(other: MutableBooleanArray) -> BooleanArray
Performs the conversion.
sourceimpl<P> From<P> for MutableBooleanArray where
P: AsRef<[Option<bool>]>,
impl<P> From<P> for MutableBooleanArray where
P: AsRef<[Option<bool>]>,
sourcefn from(slice: P) -> MutableBooleanArray
fn from(slice: P) -> MutableBooleanArray
Creates a new MutableBooleanArray
out of a slice of Optional bool
.
sourceimpl<Ptr> FromIterator<Ptr> for MutableBooleanArray where
Ptr: Borrow<Option<bool>>,
impl<Ptr> FromIterator<Ptr> for MutableBooleanArray where
Ptr: Borrow<Option<bool>>,
sourcefn from_iter<I>(iter: I) -> MutableBooleanArray where
I: IntoIterator<Item = Ptr>,
fn from_iter<I>(iter: I) -> MutableBooleanArray where
I: IntoIterator<Item = Ptr>,
Creates a value from an iterator. Read more
sourceimpl<'a> IntoIterator for &'a MutableBooleanArray
impl<'a> IntoIterator for &'a MutableBooleanArray
type IntoIter = ZipValidity<'a, bool, BitmapIter<'a>>
type IntoIter = ZipValidity<'a, bool, BitmapIter<'a>>
Which kind of iterator are we turning this into?
sourcefn into_iter(self) -> <&'a MutableBooleanArray as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a MutableBooleanArray as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
sourceimpl MutableArray for MutableBooleanArray
impl MutableArray for MutableBooleanArray
sourcefn validity(&self) -> Option<&MutableBitmap>
fn validity(&self) -> Option<&MutableBitmap>
The optional validity of the array.
sourcefn as_box(&mut self) -> Box<dyn Array + 'static, Global>
fn as_box(&mut self) -> Box<dyn Array + 'static, Global>
Convert itself to an (immutable) [‘Array’].
sourcefn as_arc(&mut self) -> Arc<dyn Array + 'static>
fn as_arc(&mut self) -> Arc<dyn Array + 'static>
Convert itself to an (immutable) atomically reference counted Array
.
sourcefn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
Convert to mutable Any
, to enable dynamic casting.
sourcefn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
Shrink the array to fit its length.
sourceimpl TryExtend<Option<bool>> for MutableBooleanArray
impl TryExtend<Option<bool>> for MutableBooleanArray
sourcefn try_extend<I>(&mut self, iter: I) -> Result<(), ArrowError> where
I: IntoIterator<Item = Option<bool>>,
fn try_extend<I>(&mut self, iter: I) -> Result<(), ArrowError> where
I: IntoIterator<Item = Option<bool>>,
This is infalible and is implemented for consistency with all other types
Auto Trait Implementations
impl RefUnwindSafe for MutableBooleanArray
impl Send for MutableBooleanArray
impl Sync for MutableBooleanArray
impl Unpin for MutableBooleanArray
impl UnwindSafe for MutableBooleanArray
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