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§

source§

impl<'a> MutableFixedSizeBinaryArray

source

pub fn iter( &'a self ) -> ZipValidity<&'a [u8], ChunksExact<'a, u8>, BitmapIter<'a>>

constructs a new iterator

source

pub fn iter_values(&'a self) -> ChunksExact<'a, u8>

Returns iterator over the values of MutableFixedSizeBinaryArray

source§

impl MutableFixedSizeBinaryArray

source

pub fn try_new( data_type: DataType, values: Vec<u8>, validity: Option<MutableBitmap> ) -> Result<Self, Error>

Creates a new MutableFixedSizeBinaryArray.

§Errors

This function returns an error iff:

source

pub fn new(size: usize) -> Self

Creates a new empty MutableFixedSizeBinaryArray.

source

pub fn with_capacity(size: usize, capacity: usize) -> Self

Creates a new MutableFixedSizeBinaryArray with capacity for capacity entries.

source

pub fn from<const N: usize, P: AsRef<[Option<[u8; N]>]>>(slice: P) -> Self

Creates a new MutableFixedSizeBinaryArray from a slice of optional [u8].

source

pub fn try_push<P: AsRef<[u8]>>( &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.

source

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.

source

pub fn len(&self) -> usize

Returns the length of this array

source

pub fn pop(&mut self) -> Option<Vec<u8>>

Pop the last entry from MutableFixedSizeBinaryArray. This function returns None iff this array is empty

source

pub fn try_from_iter<P: AsRef<[u8]>, I: IntoIterator<Item = Option<P>>>( iter: I, size: usize ) -> Result<Self, 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.

source

pub fn size(&self) -> usize

returns the (fixed) size of the MutableFixedSizeBinaryArray.

source

pub fn capacity(&self) -> usize

Returns the capacity of this array

source

pub fn value(&self, i: usize) -> &[u8]

Returns the element at index i as &[u8]

source

pub unsafe fn value_unchecked(&self, i: usize) -> &[u8]

Returns the element at index i as &[u8]

§Safety

Assumes that the i < self.len.

source

pub fn reserve(&mut self, additional: usize)

Reserves additional slots.

source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of the MutableFixedSizeBinaryArray to fit its current length.

source§

impl MutableFixedSizeBinaryArray

Accessors

source

pub fn values(&self) -> &Vec<u8>

Returns its values.

source

pub fn values_mut_slice(&mut self) -> &mut [u8]

Returns a mutable slice of values.

Trait Implementations§

source§

impl Clone for MutableFixedSizeBinaryArray

source§

fn clone(&self) -> MutableFixedSizeBinaryArray

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MutableFixedSizeBinaryArray

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray

source§

fn from(other: MutableFixedSizeBinaryArray) -> Self

Converts to this type from the input type.
source§

impl<'a> IntoIterator for &'a MutableFixedSizeBinaryArray

§

type Item = Option<&'a [u8]>

The type of the elements being iterated over.
§

type IntoIter = ZipValidity<&'a [u8], ChunksExact<'a, u8>, BitmapIter<'a>>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl MutableArray for MutableFixedSizeBinaryArray

source§

fn len(&self) -> usize

The length of the array.
source§

fn validity(&self) -> Option<&MutableBitmap>

The optional validity of the array.
source§

fn as_box(&mut self) -> Box<dyn Array>

Convert itself to an (immutable) Array.
source§

fn as_arc(&mut self) -> Arc<dyn Array>

Convert itself to an (immutable) atomically reference counted Array.
source§

fn data_type(&self) -> &DataType

The DataType of the array.
source§

fn as_any(&self) -> &dyn Any

Convert to Any, to enable dynamic casting.
source§

fn as_mut_any(&mut self) -> &mut dyn Any

Convert to mutable Any, to enable dynamic casting.
source§

fn push_null(&mut self)

Adds a new null element to the array.
source§

fn reserve(&mut self, additional: usize)

Reserves additional slots to its capacity.
source§

fn shrink_to_fit(&mut self)

Shrink the array to fit its length.
source§

fn is_empty(&self) -> bool

Whether the array is empty.
source§

fn is_valid(&self, index: usize) -> bool

Whether index is valid / set. Read more
source§

impl PartialEq for MutableFixedSizeBinaryArray

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryExtendFromSelf for MutableFixedSizeBinaryArray

source§

fn try_extend_from_self(&mut self, other: &Self) -> Result<(), Error>

Tries to extend itself with elements from other, failing only on overflow.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.