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§
Source§impl<'a> FixedSizeBinaryArray
impl<'a> FixedSizeBinaryArray
Sourcepub 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
Sourcepub fn values_iter(&'a self) -> ChunksExact<'a, u8>
pub fn values_iter(&'a self) -> ChunksExact<'a, u8>
Returns iterator over the values of FixedSizeBinaryArray
Source§impl FixedSizeBinaryArray
impl FixedSizeBinaryArray
Sourcepub fn try_new(
dtype: ArrowDataType,
values: Buffer<u8>,
validity: Option<Bitmap>,
) -> PolarsResult<Self>
pub fn try_new( dtype: ArrowDataType, values: Buffer<u8>, validity: Option<Bitmap>, ) -> PolarsResult<Self>
Creates a new FixedSizeBinaryArray
.
§Errors
This function returns an error iff:
- The
dtype
’s physical type is notcrate::datatypes::PhysicalType::FixedSizeBinary
- The length of
values
is not a multiple ofsize
indtype
- the validity’s length is not equal to
values.len() / size
.
Sourcepub fn new(
dtype: ArrowDataType,
values: Buffer<u8>,
validity: Option<Bitmap>,
) -> Self
pub fn new( dtype: ArrowDataType, values: Buffer<u8>, validity: Option<Bitmap>, ) -> Self
Creates a new FixedSizeBinaryArray
.
§Panics
This function panics iff:
- The
dtype
’s physical type is notcrate::datatypes::PhysicalType::FixedSizeBinary
- The length of
values
is not a multiple ofsize
indtype
- the validity’s length is not equal to
values.len() / size
.
Sourcepub fn new_empty(dtype: ArrowDataType) -> Self
pub fn new_empty(dtype: ArrowDataType) -> Self
Returns a new empty FixedSizeBinaryArray
.
Sourcepub fn new_null(dtype: ArrowDataType, length: usize) -> Self
pub fn new_null(dtype: ArrowDataType, length: usize) -> Self
Returns a new null FixedSizeBinaryArray
.
Source§impl FixedSizeBinaryArray
impl FixedSizeBinaryArray
Sourcepub fn slice(&mut self, offset: usize, length: usize)
pub fn slice(&mut self, offset: usize, length: usize)
Slices this FixedSizeBinaryArray
.
§Implementation
This operation is O(1)
.
§Panics
panics iff offset + length > self.len()
Sourcepub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
pub unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
Slices this FixedSizeBinaryArray
.
§Implementation
This operation is O(1)
.
§Safety
The caller must ensure that offset + length <= self.len()
.
Sourcepub unsafe fn sliced_unchecked(self, offset: usize, length: usize) -> Self
pub unsafe fn sliced_unchecked(self, offset: usize, length: usize) -> Self
Sourcepub fn with_validity(self, validity: Option<Bitmap>) -> Self
pub fn with_validity(self, validity: Option<Bitmap>) -> Self
Sourcepub fn set_validity(&mut self, validity: Option<Bitmap>)
pub fn set_validity(&mut self, validity: Option<Bitmap>)
Sourcepub fn take_validity(&mut self) -> Option<Bitmap>
pub fn take_validity(&mut self) -> Option<Bitmap>
Takes the validity of this array, leaving it without a validity mask.
Sourcepub fn boxed(self) -> Box<dyn Array>
pub fn boxed(self) -> Box<dyn Array>
Boxes this array into a Box<dyn Array>
.
Sourcepub fn arced(self) -> Arc<dyn Array>
pub fn arced(self) -> Arc<dyn Array>
Arcs this array into a std::sync::Arc<dyn Array>
.
Source§impl FixedSizeBinaryArray
impl FixedSizeBinaryArray
Sourcepub fn values(&self) -> &Buffer<u8>
pub fn values(&self) -> &Buffer<u8>
Returns the values allocated on this FixedSizeBinaryArray
.
Sourcepub unsafe fn value_unchecked(&self, i: usize) -> &[u8] ⓘ
pub unsafe fn value_unchecked(&self, i: usize) -> &[u8] ⓘ
Sourcepub fn to(self, dtype: ArrowDataType) -> Self
pub fn to(self, dtype: ArrowDataType) -> Self
Returns a new FixedSizeBinaryArray
with a different logical type.
This is O(1)
.
§Panics
Panics iff the dtype is not supported for the physical type.
Source§impl FixedSizeBinaryArray
impl FixedSizeBinaryArray
pub fn get_size(dtype: &ArrowDataType) -> usize
Source§impl FixedSizeBinaryArray
impl FixedSizeBinaryArray
Sourcepub fn try_from_iter<P: AsRef<[u8]>, I: IntoIterator<Item = Option<P>>>(
iter: I,
size: usize,
) -> PolarsResult<Self>
pub fn try_from_iter<P: AsRef<[u8]>, I: IntoIterator<Item = Option<P>>>( iter: I, size: usize, ) -> PolarsResult<Self>
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§
Source§impl Array for FixedSizeBinaryArray
impl Array for FixedSizeBinaryArray
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Any
, which enables downcasting to concrete types.Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Any
, which enables mutable downcasting to concrete types.Source§fn len(&self) -> usize
fn len(&self) -> usize
Array
. Every array has a length corresponding to the number of
elements (slots).Source§fn dtype(&self) -> &ArrowDataType
fn dtype(&self) -> &ArrowDataType
ArrowDataType
of the Array
. In combination with Array::as_any
, this can be
used to downcast trait objects (dyn Array
) to concrete arrays.Source§unsafe fn split_at_boxed_unchecked(
&self,
offset: usize,
) -> (Box<dyn Array>, Box<dyn Array>)
unsafe fn split_at_boxed_unchecked( &self, offset: usize, ) -> (Box<dyn Array>, Box<dyn Array>)
Source§unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
fn has_nulls(&self) -> bool
Source§unsafe fn is_null_unchecked(&self, i: usize) -> bool
unsafe fn is_null_unchecked(&self, i: usize) -> bool
i
is null. Read moreSource§impl Clone for FixedSizeBinaryArray
impl Clone for FixedSizeBinaryArray
Source§fn clone(&self) -> FixedSizeBinaryArray
fn clone(&self) -> FixedSizeBinaryArray
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for FixedSizeBinaryArray
impl Debug for FixedSizeBinaryArray
Source§impl<'a> From<GrowableFixedSizeBinary<'a>> for FixedSizeBinaryArray
impl<'a> From<GrowableFixedSizeBinary<'a>> for FixedSizeBinaryArray
Source§fn from(val: GrowableFixedSizeBinary<'a>) -> Self
fn from(val: GrowableFixedSizeBinary<'a>) -> Self
Source§impl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
impl From<MutableFixedSizeBinaryArray> for FixedSizeBinaryArray
Source§fn from(other: MutableFixedSizeBinaryArray) -> Self
fn from(other: MutableFixedSizeBinaryArray) -> Self
Source§impl<'a> IntoIterator for &'a FixedSizeBinaryArray
impl<'a> IntoIterator for &'a FixedSizeBinaryArray
Source§impl PartialEq<&(dyn Array + 'static)> for FixedSizeBinaryArray
impl PartialEq<&(dyn Array + 'static)> for FixedSizeBinaryArray
Source§impl PartialEq for FixedSizeBinaryArray
impl PartialEq for FixedSizeBinaryArray
Source§impl Splitable for FixedSizeBinaryArray
impl Splitable for FixedSizeBinaryArray
fn check_bound(&self, offset: usize) -> bool
Source§unsafe fn _split_at_unchecked(&self, offset: usize) -> (Self, Self)
unsafe fn _split_at_unchecked(&self, offset: usize) -> (Self, Self)
split_at_unchecked
. For any usage, prefer the using
split_at
or split_at_unchecked
. Read moreAuto Trait Implementations§
impl !Freeze for FixedSizeBinaryArray
impl RefUnwindSafe for FixedSizeBinaryArray
impl Send for FixedSizeBinaryArray
impl Sync for FixedSizeBinaryArray
impl Unpin for FixedSizeBinaryArray
impl UnwindSafe for FixedSizeBinaryArray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more