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 for ZipValidity<'a, T, I> where
I: Iterator<Item = T>, 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 for ZipValidity<'a, T, I> where
I: Iterator<Item = T>, type Item = Option<T>;
I: Iterator<Item = T>, 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<FixedSizeBinaryArray, ArrowError>
pub fn try_new(
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>
) -> Result<FixedSizeBinaryArray, 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>
) -> FixedSizeBinaryArray
pub fn new(
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>
) -> FixedSizeBinaryArray
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>
) -> FixedSizeBinaryArray
pub fn from_data(
data_type: DataType,
values: Buffer<u8>,
validity: Option<Bitmap>
) -> FixedSizeBinaryArray
Alias for new
sourcepub fn new_empty(data_type: DataType) -> FixedSizeBinaryArray
pub fn new_empty(data_type: DataType) -> FixedSizeBinaryArray
Returns a new empty FixedSizeBinaryArray
.
sourcepub fn new_null(data_type: DataType, length: usize) -> FixedSizeBinaryArray
pub fn new_null(data_type: DataType, length: usize) -> FixedSizeBinaryArray
Returns a new null FixedSizeBinaryArray
.
sourceimpl FixedSizeBinaryArray
impl FixedSizeBinaryArray
sourcepub fn slice(&self, offset: usize, length: usize) -> FixedSizeBinaryArray
pub fn slice(&self, offset: usize, length: usize) -> FixedSizeBinaryArray
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
) -> FixedSizeBinaryArray
pub unsafe fn slice_unchecked(
&self,
offset: usize,
length: usize
) -> FixedSizeBinaryArray
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>) -> FixedSizeBinaryArray
pub fn with_validity(&self, validity: Option<Bitmap>) -> FixedSizeBinaryArray
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]
sourcepub fn to(self, data_type: DataType) -> FixedSizeBinaryArray
pub fn to(self, data_type: DataType) -> FixedSizeBinaryArray
Returns a new [FixedSizeBinary
] with a different logical type.
This is O(1)
.
Panics
Panics iff the data_type is not supported for the physical type.
sourceimpl FixedSizeBinaryArray
impl FixedSizeBinaryArray
sourcepub fn try_from_iter<P, I>(
iter: I,
size: usize
) -> Result<FixedSizeBinaryArray, ArrowError> where
P: AsRef<[u8]>,
I: IntoIterator<Item = Option<P>>,
pub fn try_from_iter<P, I>(
iter: I,
size: usize
) -> Result<FixedSizeBinaryArray, ArrowError> where
P: AsRef<[u8]>,
I: IntoIterator<Item = Option<P>>,
Creates a FixedSizeBinaryArray
from an fallible iterator of optional [u8]
.
sourcepub fn from_iter<P, I>(iter: I, size: usize) -> FixedSizeBinaryArray where
P: AsRef<[u8]>,
I: IntoIterator<Item = Option<P>>,
pub fn from_iter<P, I>(iter: I, size: usize) -> FixedSizeBinaryArray where
P: AsRef<[u8]>,
I: IntoIterator<Item = Option<P>>,
Creates a FixedSizeBinaryArray
from an iterator of optional [u8]
.
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
sourceunsafe fn slice_unchecked(
&self,
offset: usize,
length: usize
) -> Box<dyn Array + 'static, Global>
unsafe fn slice_unchecked(
&self,
offset: usize,
length: usize
) -> Box<dyn Array + 'static, Global>
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>) -> FixedSizeBinaryArray
fn from(val: GrowableFixedSizeBinary<'a>) -> FixedSizeBinaryArray
Performs the conversion.
sourceimpl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
impl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
sourcefn from(other: MutableFixedSizeBinaryArray) -> FixedSizeBinaryArray
fn from(other: MutableFixedSizeBinaryArray) -> FixedSizeBinaryArray
Performs the conversion.
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?
sourcefn into_iter(self) -> <&'a FixedSizeBinaryArray as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a FixedSizeBinaryArray as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
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> Pointable for T
impl<T> Pointable for T
sourceimpl<A> PolarsArray for A where
A: Array + ?Sized,
impl<A> PolarsArray for A where
A: Array + ?Sized,
fn has_validity(&self) -> bool
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