Struct polars_arrow::array::BinaryViewArrayGeneric
source · pub struct BinaryViewArrayGeneric<T: ViewType + ?Sized> { /* private fields */ }
Implementations§
source§impl<T: ViewType + ?Sized> BinaryViewArrayGeneric<T>
impl<T: ViewType + ?Sized> BinaryViewArrayGeneric<T>
sourcepub unsafe fn new_unchecked(
data_type: ArrowDataType,
views: Buffer<View>,
buffers: Arc<[Buffer<u8>]>,
validity: Option<Bitmap>,
total_bytes_len: usize,
total_buffer_len: usize
) -> Self
pub unsafe fn new_unchecked( data_type: ArrowDataType, views: Buffer<View>, buffers: Arc<[Buffer<u8>]>, validity: Option<Bitmap>, total_bytes_len: usize, total_buffer_len: usize ) -> Self
sourcepub unsafe fn new_unchecked_unknown_md(
data_type: ArrowDataType,
views: Buffer<View>,
buffers: Arc<[Buffer<u8>]>,
validity: Option<Bitmap>,
total_buffer_len: Option<usize>
) -> Self
pub unsafe fn new_unchecked_unknown_md( data_type: ArrowDataType, views: Buffer<View>, buffers: Arc<[Buffer<u8>]>, validity: Option<Bitmap>, total_buffer_len: Option<usize> ) -> Self
Create a new BinaryViewArray but initialize a statistics compute.
§Safety
The caller must ensure the invariants
pub fn data_buffers(&self) -> &Arc<[Buffer<u8>]>
pub fn variadic_buffer_lengths(&self) -> Vec<i64>
pub fn views(&self) -> &Buffer<View>
pub fn try_new( data_type: ArrowDataType, views: Buffer<View>, buffers: Arc<[Buffer<u8>]>, validity: Option<Bitmap> ) -> PolarsResult<Self>
sourcepub fn new_empty(data_type: ArrowDataType) -> Self
pub fn new_empty(data_type: ArrowDataType) -> Self
Creates an empty BinaryViewArrayGeneric
, i.e. whose .len
is zero.
sourcepub fn new_null(data_type: ArrowDataType, length: usize) -> Self
pub fn new_null(data_type: ArrowDataType, length: usize) -> Self
Returns a new null BinaryViewArrayGeneric
of length
.
sourcepub unsafe fn value_unchecked(&self, i: usize) -> &T
pub unsafe fn value_unchecked(&self, i: usize) -> &T
sourcepub fn iter(
&self
) -> ZipValidity<&T, ArrayValuesIter<'_, BinaryViewArrayGeneric<T>>, BitmapIter<'_>> ⓘ
pub fn iter( &self ) -> ZipValidity<&T, ArrayValuesIter<'_, BinaryViewArrayGeneric<T>>, BitmapIter<'_>> ⓘ
Returns an iterator of Option<&T>
over every element of this array.
sourcepub fn values_iter(&self) -> ArrayValuesIter<'_, BinaryViewArrayGeneric<T>> ⓘ
pub fn values_iter(&self) -> ArrayValuesIter<'_, BinaryViewArrayGeneric<T>> ⓘ
Returns an iterator of &[u8]
over every element of this array, ignoring the validity
pub fn len_iter(&self) -> impl Iterator<Item = u32> + '_
sourcepub fn non_null_values_iter(
&self
) -> NonNullValuesIter<'_, BinaryViewArrayGeneric<T>> ⓘ
pub fn non_null_values_iter( &self ) -> NonNullValuesIter<'_, BinaryViewArrayGeneric<T>> ⓘ
Returns an iterator of the non-null values.
sourcepub fn non_null_views_iter(&self) -> NonNullValuesIter<'_, Buffer<View>> ⓘ
pub fn non_null_views_iter(&self) -> NonNullValuesIter<'_, Buffer<View>> ⓘ
Returns an iterator of the non-null values.
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>
.
pub fn from_slice<S: AsRef<T>, P: AsRef<[Option<S>]>>(slice: P) -> Self
pub fn from_slice_values<S: AsRef<T>, P: AsRef<[S]>>(slice: P) -> Self
sourcepub fn total_bytes_len(&self) -> usize
pub fn total_bytes_len(&self) -> usize
Get the total length of bytes that it would take to concatenate all binary/str values in this array.
sourcepub fn total_buffer_len(&self) -> usize
pub fn total_buffer_len(&self) -> usize
Get the length of bytes that are stored in the variadic buffers.
pub fn len(&self) -> usize
pub fn is_sliced(&self) -> bool
pub fn maybe_gc(self) -> Self
pub fn make_mut(self) -> MutableBinaryViewArray<T>
source§impl BinaryViewArrayGeneric<[u8]>
impl BinaryViewArrayGeneric<[u8]>
sourcepub fn validate_utf8(&self) -> PolarsResult<()>
pub fn validate_utf8(&self) -> PolarsResult<()>
Validate the underlying bytes on UTF-8.
sourcepub fn to_utf8view(&self) -> PolarsResult<Utf8ViewArray>
pub fn to_utf8view(&self) -> PolarsResult<Utf8ViewArray>
Convert BinaryViewArray
to Utf8ViewArray
.
sourcepub unsafe fn to_utf8view_unchecked(&self) -> Utf8ViewArray
pub unsafe fn to_utf8view_unchecked(&self) -> Utf8ViewArray
Convert BinaryViewArray
to Utf8ViewArray
without checking UTF-8.
§Safety
The caller must ensure the underlying data is valid UTF-8.
source§impl BinaryViewArrayGeneric<str>
impl BinaryViewArrayGeneric<str>
pub fn to_binview(&self) -> BinaryViewArray
Trait Implementations§
source§impl<T: ViewType + ?Sized> Array for BinaryViewArrayGeneric<T>
impl<T: ViewType + ?Sized> Array for BinaryViewArrayGeneric<T>
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 data_type(&self) -> &ArrowDataType
fn data_type(&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 slice_unchecked(&mut self, offset: usize, length: usize)
unsafe fn slice_unchecked(&mut self, offset: usize, length: usize)
source§unsafe fn is_null_unchecked(&self, i: usize) -> bool
unsafe fn is_null_unchecked(&self, i: usize) -> bool
i
is null. Read more