Struct arrow2::array::MutableFixedSizeBinaryArray
source · [−]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
sourceimpl<'a> MutableFixedSizeBinaryArray
impl<'a> MutableFixedSizeBinaryArray
sourcepub fn iter(
&'a self
) -> ZipValidity<'a, &'a [u8], FixedSizeBinaryValuesIter<'a, MutableFixedSizeBinaryArray>>ⓘNotable traits for ZipValidity<'a, T, I>impl<'a, T, I: Iterator<Item = T>> Iterator for ZipValidity<'a, T, I> type Item = Option<T>;
pub fn iter(
&'a self
) -> ZipValidity<'a, &'a [u8], FixedSizeBinaryValuesIter<'a, MutableFixedSizeBinaryArray>>ⓘNotable traits for ZipValidity<'a, T, I>impl<'a, T, I: Iterator<Item = T>> Iterator for ZipValidity<'a, T, I> type Item = Option<T>;
constructs a new iterator
sourcepub fn iter_values(
&'a self
) -> FixedSizeBinaryValuesIter<'a, MutableFixedSizeBinaryArray>
pub fn iter_values(
&'a self
) -> FixedSizeBinaryValuesIter<'a, MutableFixedSizeBinaryArray>
Returns iterator over the values of MutableFixedSizeBinaryArray
sourceimpl MutableFixedSizeBinaryArray
impl MutableFixedSizeBinaryArray
sourcepub fn from_data(
data_type: DataType,
values: Vec<u8>,
validity: Option<MutableBitmap>
) -> Self
pub fn from_data(
data_type: DataType,
values: Vec<u8>,
validity: Option<MutableBitmap>
) -> Self
Canonical method to create a new MutableFixedSizeBinaryArray
.
sourcepub fn new(size: usize) -> Self
pub fn new(size: usize) -> Self
Creates a new empty MutableFixedSizeBinaryArray
.
sourcepub fn with_capacity(size: usize, capacity: usize) -> Self
pub fn with_capacity(size: usize, capacity: usize) -> Self
Creates a new MutableFixedSizeBinaryArray
with capacity for capacity
entries.
sourcepub fn try_push<P: AsRef<[u8]>>(&mut self, value: Option<P>) -> Result<()>
pub fn try_push<P: AsRef<[u8]>>(&mut self, value: Option<P>) -> Result<()>
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: AsRef<[u8]>>(&mut self, value: Option<P>)
pub fn push<P: AsRef<[u8]>>(&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: AsRef<[u8]>, I: IntoIterator<Item = Option<P>>>(
iter: I,
size: usize
) -> Result<Self>
pub fn try_from_iter<P: AsRef<[u8]>, I: IntoIterator<Item = Option<P>>>(
iter: I,
size: usize
) -> Result<Self>
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 fn value(&self, i: usize) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn value(&self, i: usize) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns the element at index i
as &[u8]
sourcepub unsafe fn value_unchecked(&self, i: usize) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub unsafe fn value_unchecked(&self, i: usize) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [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.
sourceimpl MutableFixedSizeBinaryArray
impl MutableFixedSizeBinaryArray
Accessors
Trait Implementations
sourceimpl Debug for MutableFixedSizeBinaryArray
impl Debug for MutableFixedSizeBinaryArray
sourceimpl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
impl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
sourcefn from(other: MutableFixedSizeBinaryArray) -> Self
fn from(other: MutableFixedSizeBinaryArray) -> Self
Converts to this type from the input type.
sourceimpl<'a> IntoIterator for &'a MutableFixedSizeBinaryArray
impl<'a> IntoIterator for &'a MutableFixedSizeBinaryArray
type IntoIter = ZipValidity<'a, &'a [u8], FixedSizeBinaryValuesIter<'a, MutableFixedSizeBinaryArray>>
type IntoIter = ZipValidity<'a, &'a [u8], FixedSizeBinaryValuesIter<'a, MutableFixedSizeBinaryArray>>
Which kind of iterator are we turning this into?
sourceimpl MutableArray for MutableFixedSizeBinaryArray
impl MutableArray for MutableFixedSizeBinaryArray
sourcefn validity(&self) -> Option<&MutableBitmap>
fn validity(&self) -> Option<&MutableBitmap>
The optional validity of the array.
sourcefn as_arc(&mut self) -> Arc<dyn Array>
fn as_arc(&mut self) -> Arc<dyn Array>
Convert itself to an (immutable) atomically reference counted Array
.
sourcefn as_mut_any(&mut self) -> &mut dyn Any
fn as_mut_any(&mut self) -> &mut dyn Any
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 PartialEq<MutableFixedSizeBinaryArray> for MutableFixedSizeBinaryArray
impl PartialEq<MutableFixedSizeBinaryArray> for MutableFixedSizeBinaryArray
Auto Trait Implementations
impl RefUnwindSafe for MutableFixedSizeBinaryArray
impl Send for MutableFixedSizeBinaryArray
impl Sync for MutableFixedSizeBinaryArray
impl Unpin for MutableFixedSizeBinaryArray
impl UnwindSafe for MutableFixedSizeBinaryArray
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