pub struct MutableFixedSizeBinaryArray { /* private fields */ }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).
Implementations§
source§impl<'a> MutableFixedSizeBinaryArray
impl<'a> MutableFixedSizeBinaryArray
sourcepub 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
sourcepub fn iter_values(&'a self) -> ChunksExact<'a, u8>
pub fn iter_values(&'a self) -> ChunksExact<'a, u8>
Returns iterator over the values of MutableFixedSizeBinaryArray
source§impl MutableFixedSizeBinaryArray
impl MutableFixedSizeBinaryArray
sourcepub 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
valuesis not a multiple ofsizeindata_type - the validity’s length is not equal to
values.len() / size.
sourcepub fn new(size: usize) -> MutableFixedSizeBinaryArray
pub fn new(size: usize) -> MutableFixedSizeBinaryArray
Creates a new empty MutableFixedSizeBinaryArray.
sourcepub 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.
sourcepub 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].
sourcepub 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.
sourcepub 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.
sourcepub 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
sourcepub 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.
sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
returns the (fixed) size of the MutableFixedSizeBinaryArray.
sourcepub unsafe fn value_unchecked(&self, i: usize) -> &[u8] ⓘ
pub unsafe fn value_unchecked(&self, i: usize) -> &[u8] ⓘ
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the MutableFixedSizeBinaryArray to fit its current length.
Trait Implementations§
source§impl Clone for MutableFixedSizeBinaryArray
impl Clone for MutableFixedSizeBinaryArray
source§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 moresource§impl Debug for MutableFixedSizeBinaryArray
impl Debug for MutableFixedSizeBinaryArray
source§impl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
impl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
source§fn from(other: MutableFixedSizeBinaryArray) -> FixedSizeBinaryArray
fn from(other: MutableFixedSizeBinaryArray) -> FixedSizeBinaryArray
source§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>>
source§fn into_iter(
self
) -> <&'a MutableFixedSizeBinaryArray as IntoIterator>::IntoIter
fn into_iter( self ) -> <&'a MutableFixedSizeBinaryArray as IntoIterator>::IntoIter
source§impl MutableArray for MutableFixedSizeBinaryArray
impl MutableArray for MutableFixedSizeBinaryArray
source§fn validity(&self) -> Option<&MutableBitmap>
fn validity(&self) -> Option<&MutableBitmap>
source§fn as_arc(&mut self) -> Arc<dyn Array>
fn as_arc(&mut self) -> Arc<dyn Array>
Array.source§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.source§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
source§impl PartialEq for MutableFixedSizeBinaryArray
impl PartialEq for MutableFixedSizeBinaryArray
source§fn eq(&self, other: &MutableFixedSizeBinaryArray) -> bool
fn eq(&self, other: &MutableFixedSizeBinaryArray) -> bool
self and other values to be equal, and is used
by ==.source§impl TryExtendFromSelf for MutableFixedSizeBinaryArray
impl TryExtendFromSelf for MutableFixedSizeBinaryArray
source§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>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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