Struct arrow2::array::FixedSizeBinaryArray
source · [−]pub struct FixedSizeBinaryArray { /* private fields */ }
Expand description
The Arrow’s equivalent to an immutable Vec<Option<[u8; size]>>
.
Cloning and slicing this struct is O(1)
.
Implementations
sourceimpl<'a> FixedSizeBinaryArray
impl<'a> FixedSizeBinaryArray
sourcepub fn iter(
&'a self
) -> ZipValidity<'a, &'a [u8], FixedSizeBinaryValuesIter<'a, FixedSizeBinaryArray>>ⓘ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, FixedSizeBinaryArray>>ⓘ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, FixedSizeBinaryArray>
pub fn iter_values(
&'a self
) -> FixedSizeBinaryValuesIter<'a, FixedSizeBinaryArray>
Returns iterator over the values of FixedSizeBinaryArray
sourceimpl FixedSizeBinaryArray
impl FixedSizeBinaryArray
sourcepub fn try_new(
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>
) -> Result<Self, ArrowError>
pub fn try_new(
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>
) -> Result<Self, ArrowError>
Creates a new FixedSizeBinaryArray
.
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
.
sourcepub fn new(
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>
) -> Self
pub fn new(
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>
) -> Self
Creates a new FixedSizeBinaryArray
.
Panics
This function panics 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
.
sourcepub fn from_data(
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>
) -> Self
pub fn from_data(
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>
) -> Self
Alias for new
sourcepub fn new_empty(data_type: DataType) -> Self
pub fn new_empty(data_type: DataType) -> Self
Returns a new empty FixedSizeBinaryArray
.
sourcepub fn new_null(data_type: DataType, length: usize) -> Self
pub fn new_null(data_type: DataType, length: usize) -> Self
Returns a new null FixedSizeBinaryArray
.
sourceimpl FixedSizeBinaryArray
impl FixedSizeBinaryArray
sourcepub fn slice(&self, offset: usize, length: usize) -> Self
pub fn slice(&self, offset: usize, length: usize) -> Self
Returns a slice of this FixedSizeBinaryArray
.
Implementation
This operation is O(1)
as it amounts to increase 3 ref counts.
Panics
panics iff offset + length > self.len()
sourcepub unsafe fn slice_unchecked(&self, offset: usize, length: usize) -> Self
pub unsafe fn slice_unchecked(&self, offset: usize, length: usize) -> Self
Returns a slice of this FixedSizeBinaryArray
.
Implementation
This operation is O(1)
as it amounts to increase 3 ref counts.
Safety
The caller must ensure that offset + length <= self.len()
.
sourcepub fn with_validity(&self, validity: Option<Bitmap>) -> Self
pub fn with_validity(&self, validity: Option<Bitmap>) -> Self
Sets the validity bitmap on this FixedSizeBinaryArray
.
Panic
This function panics iff validity.len() != self.len()
.
sourceimpl FixedSizeBinaryArray
impl FixedSizeBinaryArray
sourcepub fn values(&self) -> &Buffer<u8>
pub fn values(&self) -> &Buffer<u8>
Returns the values allocated on this FixedSizeBinaryArray
.
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]
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]
sourceimpl FixedSizeBinaryArray
impl FixedSizeBinaryArray
sourcepub fn try_from_iter<P: AsRef<[u8]>, I: IntoIterator<Item = Option<P>>>(
iter: I,
size: usize
) -> Result<Self, ArrowError>
pub fn try_from_iter<P: AsRef<[u8]>, I: IntoIterator<Item = Option<P>>>(
iter: I,
size: usize
) -> Result<Self, ArrowError>
Creates a FixedSizeBinaryArray
from an fallible iterator of optional [u8]
.
sourcepub fn from_iter<P: AsRef<[u8]>, I: IntoIterator<Item = Option<P>>>(
iter: I,
size: usize
) -> Self
pub fn from_iter<P: AsRef<[u8]>, I: IntoIterator<Item = Option<P>>>(
iter: I,
size: usize
) -> Self
Creates a FixedSizeBinaryArray
from an iterator of optional [u8]
.
sourcepub fn from_slice<const N: usize, P: AsRef<[[u8; N]]>>(a: P) -> Self
pub fn from_slice<const N: usize, P: AsRef<[[u8; N]]>>(a: P) -> Self
Creates a FixedSizeBinaryArray
from a slice of arrays of bytes
Trait Implementations
sourceimpl Array for FixedSizeBinaryArray
impl Array for FixedSizeBinaryArray
sourcefn data_type(&self) -> &DataType
fn data_type(&self) -> &DataType
The DataType
of the Array
. In combination with Array::as_any
, this can be
used to downcast trait objects (dyn Array
) to concrete arrays. Read more
sourcefn null_count(&self) -> usize
fn null_count(&self) -> usize
sourceimpl Clone for FixedSizeBinaryArray
impl Clone for FixedSizeBinaryArray
sourcefn clone(&self) -> FixedSizeBinaryArray
fn clone(&self) -> FixedSizeBinaryArray
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FixedSizeBinaryArray
impl Debug for FixedSizeBinaryArray
sourceimpl<'a> From<GrowableFixedSizeBinary<'a>> for FixedSizeBinaryArray
impl<'a> From<GrowableFixedSizeBinary<'a>> for FixedSizeBinaryArray
sourcefn from(val: GrowableFixedSizeBinary<'a>) -> Self
fn from(val: GrowableFixedSizeBinary<'a>) -> Self
Converts to this type from the input type.
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 FixedSizeBinaryArray
impl<'a> IntoIterator for &'a FixedSizeBinaryArray
type IntoIter = ZipValidity<'a, &'a [u8], FixedSizeBinaryValuesIter<'a, FixedSizeBinaryArray>>
type IntoIter = ZipValidity<'a, &'a [u8], FixedSizeBinaryValuesIter<'a, FixedSizeBinaryArray>>
Which kind of iterator are we turning this into?
sourceimpl PartialEq<&'_ (dyn Array + '_)> for FixedSizeBinaryArray
impl PartialEq<&'_ (dyn Array + '_)> for FixedSizeBinaryArray
Auto Trait Implementations
impl RefUnwindSafe for FixedSizeBinaryArray
impl Send for FixedSizeBinaryArray
impl Sync for FixedSizeBinaryArray
impl Unpin for FixedSizeBinaryArray
impl UnwindSafe for FixedSizeBinaryArray
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more