Struct polars::export::arrow::array::MutableFixedSizeBinaryArray
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§
§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, Global>,
validity: Option<MutableBitmap>
) -> Result<MutableFixedSizeBinaryArray, Error>
pub fn try_new( data_type: DataType, values: Vec<u8, Global>, 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.
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) -> MutableFixedSizeBinaryArraywhere
P: AsRef<[Option<[u8; N]>]>,
pub fn from<const N: usize, P>(slice: P) -> MutableFixedSizeBinaryArraywhere P: AsRef<[Option<[u8; N]>]>,
Creates a new MutableFixedSizeBinaryArray from a slice of optional [u8].
pub fn try_push<P>(&mut self, value: Option<P>) -> Result<(), Error>where
P: AsRef<[u8]>,
pub fn try_push<P>(&mut self, value: Option<P>) -> Result<(), Error>where P: AsRef<[u8]>,
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>)where
P: AsRef<[u8]>,
pub fn push<P>(&mut self, value: Option<P>)where P: AsRef<[u8]>,
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, Global>>
pub fn pop(&mut self) -> Option<Vec<u8, Global>>
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>where
P: AsRef<[u8]>,
I: IntoIterator<Item = Option<P>>,
pub fn try_from_iter<P, I>( iter: I, size: usize ) -> Result<MutableFixedSizeBinaryArray, Error>where P: AsRef<[u8]>, I: IntoIterator<Item = Option<P>>,
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 + 'static>
fn as_arc(&mut self) -> Arc<dyn Array + 'static>
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<MutableFixedSizeBinaryArray> for MutableFixedSizeBinaryArray
impl PartialEq<MutableFixedSizeBinaryArray> 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.