Struct re_sdk::external::arrow2::array::MutableFixedSizeBinaryArray
pub struct MutableFixedSizeBinaryArray {
data_type: DataType,
size: usize,
values: Vec<u8>,
validity: Option<MutableBitmap>,
}
Expand description
The Arrow’s equivalent to a mutable Vec<Option<[u8; size]>>
.
Converting a MutableFixedSizeBinaryArray
into a FixedSizeBinaryArray
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
§size: usize
§values: Vec<u8>
§validity: Option<MutableBitmap>
Implementations§
§impl<'a> MutableFixedSizeBinaryArray
impl<'a> MutableFixedSizeBinaryArray
pub fn iter(
&'a self
) -> ZipValidity<&'a [u8], ChunksExact<'a, u8>, BitmapIter<'a>> ⓘ
pub fn iter( &'a self ) -> ZipValidity<&'a [u8], ChunksExact<'a, u8>, BitmapIter<'a>> ⓘ
constructs a new iterator
pub fn iter_values(&'a self) -> ChunksExact<'a, u8>
pub fn iter_values(&'a self) -> ChunksExact<'a, u8>
Returns iterator over the values of MutableFixedSizeBinaryArray
§impl MutableFixedSizeBinaryArray
impl MutableFixedSizeBinaryArray
pub fn try_new(
data_type: DataType,
values: Vec<u8>,
validity: Option<MutableBitmap>
) -> Result<MutableFixedSizeBinaryArray, Error>
pub fn try_new( data_type: DataType, values: Vec<u8>, validity: Option<MutableBitmap> ) -> Result<MutableFixedSizeBinaryArray, Error>
Creates a new MutableFixedSizeBinaryArray
.
§Errors
This function returns an error iff:
- The
data_type
’s physical type is notcrate::datatypes::PhysicalType::FixedSizeBinary
- The length of
values
is not a multiple ofsize
indata_type
- the validity’s length is not equal to
values.len() / size
.
pub fn new(size: usize) -> MutableFixedSizeBinaryArray
pub fn new(size: usize) -> MutableFixedSizeBinaryArray
Creates a new empty MutableFixedSizeBinaryArray
.
pub fn with_capacity(
size: usize,
capacity: usize
) -> MutableFixedSizeBinaryArray
pub fn with_capacity( size: usize, capacity: usize ) -> MutableFixedSizeBinaryArray
Creates a new MutableFixedSizeBinaryArray
with capacity for capacity
entries.
pub fn from<const N: usize, P>(slice: P) -> MutableFixedSizeBinaryArray
pub fn from<const N: usize, P>(slice: P) -> MutableFixedSizeBinaryArray
Creates a new MutableFixedSizeBinaryArray
from a slice of optional [u8]
.
pub fn try_push<P>(&mut self, value: Option<P>) -> Result<(), Error>
pub fn try_push<P>(&mut self, value: Option<P>) -> Result<(), Error>
tries to push a new entry to MutableFixedSizeBinaryArray
.
§Error
Errors iff the size of value
is not equal to its own size.
pub fn push<P>(&mut self, value: Option<P>)
pub fn push<P>(&mut self, value: Option<P>)
pushes a new entry to MutableFixedSizeBinaryArray
.
§Panics
Panics iff the size of value
is not equal to its own size.
pub fn pop(&mut self) -> Option<Vec<u8>>
pub fn pop(&mut self) -> Option<Vec<u8>>
Pop the last entry from MutableFixedSizeBinaryArray
.
This function returns None
iff this array is empty
pub fn try_from_iter<P, I>(
iter: I,
size: usize
) -> Result<MutableFixedSizeBinaryArray, Error>
pub fn try_from_iter<P, I>( iter: I, size: usize ) -> Result<MutableFixedSizeBinaryArray, Error>
Creates a new MutableFixedSizeBinaryArray
from an iterator of values.
§Errors
Errors iff the size of any of the value
is not equal to its own size.
pub fn size(&self) -> usize
pub fn size(&self) -> usize
returns the (fixed) size of the MutableFixedSizeBinaryArray
.
pub unsafe fn value_unchecked(&self, i: usize) -> &[u8] ⓘ
pub unsafe fn value_unchecked(&self, i: usize) -> &[u8] ⓘ
pub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the MutableFixedSizeBinaryArray
to fit its current length.
§impl MutableFixedSizeBinaryArray
impl MutableFixedSizeBinaryArray
Accessors
Trait Implementations§
§impl Clone for MutableFixedSizeBinaryArray
impl Clone for MutableFixedSizeBinaryArray
§fn clone(&self) -> MutableFixedSizeBinaryArray
fn clone(&self) -> MutableFixedSizeBinaryArray
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for MutableFixedSizeBinaryArray
impl Debug for MutableFixedSizeBinaryArray
§impl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
impl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
§fn from(other: MutableFixedSizeBinaryArray) -> FixedSizeBinaryArray
fn from(other: MutableFixedSizeBinaryArray) -> FixedSizeBinaryArray
§impl<'a> IntoIterator for &'a MutableFixedSizeBinaryArray
impl<'a> IntoIterator for &'a MutableFixedSizeBinaryArray
§type IntoIter = ZipValidity<&'a [u8], ChunksExact<'a, u8>, BitmapIter<'a>>
type IntoIter = ZipValidity<&'a [u8], ChunksExact<'a, u8>, BitmapIter<'a>>
§fn into_iter(
self
) -> <&'a MutableFixedSizeBinaryArray as IntoIterator>::IntoIter
fn into_iter( self ) -> <&'a MutableFixedSizeBinaryArray as IntoIterator>::IntoIter
§impl MutableArray for MutableFixedSizeBinaryArray
impl MutableArray for MutableFixedSizeBinaryArray
§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 MutableFixedSizeBinaryArray
impl PartialEq for MutableFixedSizeBinaryArray
§fn eq(&self, other: &MutableFixedSizeBinaryArray) -> bool
fn eq(&self, other: &MutableFixedSizeBinaryArray) -> bool
self
and other
values to be equal, and is used
by ==
.§impl TryExtendFromSelf for MutableFixedSizeBinaryArray
impl TryExtendFromSelf for MutableFixedSizeBinaryArray
§fn try_extend_from_self(
&mut self,
other: &MutableFixedSizeBinaryArray
) -> Result<(), Error>
fn try_extend_from_self( &mut self, other: &MutableFixedSizeBinaryArray ) -> Result<(), Error>
other
, failing only on overflow.Auto Trait Implementations§
impl Freeze for MutableFixedSizeBinaryArray
impl RefUnwindSafe for MutableFixedSizeBinaryArray
impl Send for MutableFixedSizeBinaryArray
impl Sync for MutableFixedSizeBinaryArray
impl Unpin for MutableFixedSizeBinaryArray
impl UnwindSafe for MutableFixedSizeBinaryArray
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 more