Struct re_viewer::external::arrow2::array::MutableBooleanArray
pub struct MutableBooleanArray {
data_type: DataType,
values: MutableBitmap,
validity: Option<MutableBitmap>,
}
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).
Fields§
§data_type: DataType
§values: MutableBitmap
§validity: Option<MutableBitmap>
Implementations§
§impl<'a> MutableBooleanArray
impl<'a> MutableBooleanArray
pub fn iter(&'a self) -> ZipValidity<bool, BitmapIter<'a>, BitmapIter<'a>> ⓘ
pub fn iter(&'a self) -> ZipValidity<bool, BitmapIter<'a>, BitmapIter<'a>> ⓘ
Returns an iterator over the optional values of this MutableBooleanArray
.
pub fn values_iter(&'a self) -> BitmapIter<'a> ⓘ
pub fn values_iter(&'a self) -> BitmapIter<'a> ⓘ
Returns an iterator over the values of this MutableBooleanArray
§impl MutableBooleanArray
impl MutableBooleanArray
pub fn new() -> MutableBooleanArray
pub fn new() -> MutableBooleanArray
Creates an new empty MutableBooleanArray
.
pub fn try_new(
data_type: DataType,
values: MutableBitmap,
validity: Option<MutableBitmap>
) -> Result<MutableBooleanArray, Error>
pub fn try_new( data_type: DataType, values: MutableBitmap, validity: Option<MutableBitmap> ) -> Result<MutableBooleanArray, Error>
The canonical method to create a MutableBooleanArray
out of low-end APIs.
§Errors
This function errors iff:
- The validity is not
None
and its length is different fromvalues
’s length - The
data_type
’sPhysicalType
is not equal toPhysicalType::Boolean
.
pub fn with_capacity(capacity: usize) -> MutableBooleanArray
pub fn with_capacity(capacity: usize) -> MutableBooleanArray
Creates an new MutableBooleanArray
with a capacity of values.
pub fn push(&mut self, value: Option<bool>)
pub fn push(&mut self, value: Option<bool>)
Pushes a new entry to MutableBooleanArray
.
pub fn pop(&mut self) -> Option<bool>
pub fn pop(&mut self) -> Option<bool>
Pop an entry from MutableBooleanArray
.
Note If the values is empty, this method will return None.
pub 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.
pub unsafe fn extend_trusted_len_values_unchecked<I>(&mut self, iterator: I)
pub unsafe fn extend_trusted_len_values_unchecked<I>(&mut self, iterator: I)
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.
pub fn extend_trusted_len<I, P>(&mut self, iterator: I)
pub fn extend_trusted_len<I, P>(&mut self, iterator: I)
Extends the MutableBooleanArray
from an iterator of trusted len.
pub unsafe fn extend_trusted_len_unchecked<I, P>(&mut self, iterator: I)
pub unsafe fn extend_trusted_len_unchecked<I, P>(&mut self, iterator: I)
Extends the MutableBooleanArray
from an iterator of trusted len.
§Safety
The iterator must be trusted len.
§impl MutableBooleanArray
impl MutableBooleanArray
Setters
§impl MutableBooleanArray
impl MutableBooleanArray
From implementations
pub fn from_trusted_len_values_iter<I>(iterator: I) -> MutableBooleanArraywhere
I: TrustedLen<Item = bool>,
pub fn from_trusted_len_values_iter<I>(iterator: I) -> MutableBooleanArraywhere
I: TrustedLen<Item = bool>,
Creates a new MutableBooleanArray
from an TrustedLen
of bool
.
pub unsafe fn from_trusted_len_values_iter_unchecked<I>(
iterator: I
) -> MutableBooleanArray
pub unsafe fn from_trusted_len_values_iter_unchecked<I>( iterator: I ) -> MutableBooleanArray
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.
pub fn from_slice<P>(slice: P) -> MutableBooleanArray
pub fn from_slice<P>(slice: P) -> MutableBooleanArray
Creates a new MutableBooleanArray
from a slice of bool
.
pub unsafe fn from_trusted_len_iter_unchecked<I, P>(
iterator: I
) -> MutableBooleanArray
pub unsafe fn from_trusted_len_iter_unchecked<I, P>( iterator: I ) -> MutableBooleanArray
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) -> MutableBooleanArray
pub fn from_trusted_len_iter<I, P>(iterator: I) -> MutableBooleanArray
Creates a BooleanArray
from a TrustedLen
.
pub unsafe fn try_from_trusted_len_iter_unchecked<E, I, P>(
iterator: I
) -> Result<MutableBooleanArray, E>
pub unsafe fn try_from_trusted_len_iter_unchecked<E, I, P>( iterator: I ) -> Result<MutableBooleanArray, 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.
pub fn try_from_trusted_len_iter<E, I, P>(
iterator: I
) -> Result<MutableBooleanArray, E>
pub fn try_from_trusted_len_iter<E, I, P>( iterator: I ) -> Result<MutableBooleanArray, E>
Creates a BooleanArray
from a TrustedLen
.
pub 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§
§impl Clone for MutableBooleanArray
impl Clone for MutableBooleanArray
§fn clone(&self) -> MutableBooleanArray
fn clone(&self) -> MutableBooleanArray
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for MutableBooleanArray
impl Debug for MutableBooleanArray
§impl Default for MutableBooleanArray
impl Default for MutableBooleanArray
§fn default() -> MutableBooleanArray
fn default() -> MutableBooleanArray
§impl Extend<Option<bool>> for MutableBooleanArray
impl Extend<Option<bool>> for MutableBooleanArray
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)§impl From<MutableBooleanArray> for BooleanArray
impl From<MutableBooleanArray> for BooleanArray
§fn from(other: MutableBooleanArray) -> BooleanArray
fn from(other: MutableBooleanArray) -> BooleanArray
§impl<P> From<P> for MutableBooleanArray
impl<P> From<P> for MutableBooleanArray
§fn from(slice: P) -> MutableBooleanArray
fn from(slice: P) -> MutableBooleanArray
Creates a new MutableBooleanArray
out of a slice of Optional bool
.
§impl<Ptr> FromIterator<Ptr> for MutableBooleanArray
impl<Ptr> FromIterator<Ptr> for MutableBooleanArray
§fn from_iter<I>(iter: I) -> MutableBooleanArraywhere
I: IntoIterator<Item = Ptr>,
fn from_iter<I>(iter: I) -> MutableBooleanArraywhere
I: IntoIterator<Item = Ptr>,
§impl<'a> IntoIterator for &'a MutableBooleanArray
impl<'a> IntoIterator for &'a MutableBooleanArray
§type IntoIter = ZipValidity<bool, BitmapIter<'a>, BitmapIter<'a>>
type IntoIter = ZipValidity<bool, BitmapIter<'a>, BitmapIter<'a>>
§fn into_iter(self) -> <&'a MutableBooleanArray as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a MutableBooleanArray as IntoIterator>::IntoIter
§impl MutableArray for MutableBooleanArray
impl MutableArray for MutableBooleanArray
§fn validity(&self) -> Option<&MutableBitmap>
fn validity(&self) -> Option<&MutableBitmap>
§fn as_arc(&mut self) -> Arc<dyn Array>
fn as_arc(&mut self) -> Arc<dyn Array>
Array
.§fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
Any
, to enable dynamic casting.§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
§impl PartialEq for MutableBooleanArray
impl PartialEq for MutableBooleanArray
§fn eq(&self, other: &MutableBooleanArray) -> bool
fn eq(&self, other: &MutableBooleanArray) -> bool
self
and other
values to be equal, and is used
by ==
.§impl TryExtend<Option<bool>> for MutableBooleanArray
impl TryExtend<Option<bool>> for MutableBooleanArray
§fn try_extend<I>(&mut self, iter: I) -> Result<(), Error>
fn try_extend<I>(&mut self, iter: I) -> Result<(), Error>
This is infalible and is implemented for consistency with all other types
§impl TryExtendFromSelf for MutableBooleanArray
impl TryExtendFromSelf for MutableBooleanArray
§fn try_extend_from_self(
&mut self,
other: &MutableBooleanArray
) -> Result<(), Error>
fn try_extend_from_self( &mut self, other: &MutableBooleanArray ) -> Result<(), Error>
other
, failing only on overflow.Auto Trait Implementations§
impl Freeze for MutableBooleanArray
impl RefUnwindSafe for MutableBooleanArray
impl Send for MutableBooleanArray
impl Sync for MutableBooleanArray
impl Unpin for MutableBooleanArray
impl UnwindSafe for MutableBooleanArray
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
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>,
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>
§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>
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>
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)
&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)
&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> ⓘ
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> ⓘ
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<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request