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 into_views(self) -> Vec<View>
pub fn into_inner( self, ) -> (Buffer<View>, Arc<[Buffer<u8>]>, Option<Bitmap>, usize, usize)
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 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)
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<'a, T: ViewType + ?Sized> ArrayAccessor<'a> for BinaryViewArrayGeneric<T>
impl<'a, T: ViewType + ?Sized> ArrayAccessor<'a> for BinaryViewArrayGeneric<T>
source§impl<'a, T: ViewType + ?Sized> From<GrowableBinaryViewArray<'a, T>> for BinaryViewArrayGeneric<T>
impl<'a, T: ViewType + ?Sized> From<GrowableBinaryViewArray<'a, T>> for BinaryViewArrayGeneric<T>
source§fn from(val: GrowableBinaryViewArray<'a, T>) -> Self
fn from(val: GrowableBinaryViewArray<'a, T>) -> Self
source§impl<T: ViewType + ?Sized> From<MutableBinaryViewArray<T>> for BinaryViewArrayGeneric<T>
impl<T: ViewType + ?Sized> From<MutableBinaryViewArray<T>> for BinaryViewArrayGeneric<T>
source§fn from(value: MutableBinaryViewArray<T>) -> Self
fn from(value: MutableBinaryViewArray<T>) -> Self
source§impl<'a, T: ViewType + ?Sized> IntoIterator for &'a BinaryViewArrayGeneric<T>
impl<'a, T: ViewType + ?Sized> IntoIterator for &'a BinaryViewArrayGeneric<T>
§type IntoIter = ZipValidity<&'a T, ArrayValuesIter<'a, BinaryViewArrayGeneric<T>>, BitmapIter<'a>>
type IntoIter = ZipValidity<&'a T, ArrayValuesIter<'a, BinaryViewArrayGeneric<T>>, BitmapIter<'a>>
source§impl<T: ViewType + ?Sized> PartialEq for BinaryViewArrayGeneric<T>
impl<T: ViewType + ?Sized> PartialEq for BinaryViewArrayGeneric<T>
source§impl<T: ViewType + ?Sized> Splitable for BinaryViewArrayGeneric<T>
impl<T: ViewType + ?Sized> Splitable for BinaryViewArrayGeneric<T>
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 moresource§fn split_at(&self, offset: usize) -> (Self, Self)
fn split_at(&self, offset: usize) -> (Self, Self)
source§unsafe fn split_at_unchecked(&self, offset: usize) -> (Self, Self)
unsafe fn split_at_unchecked(&self, offset: usize) -> (Self, Self)
impl<T: ViewType + ?Sized> Send for BinaryViewArrayGeneric<T>
impl<T: ViewType + ?Sized> Sync for BinaryViewArrayGeneric<T>
Auto Trait Implementations§
impl<T> !Freeze for BinaryViewArrayGeneric<T>
impl<T> RefUnwindSafe for BinaryViewArrayGeneric<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Unpin for BinaryViewArrayGeneric<T>
impl<T> UnwindSafe for BinaryViewArrayGeneric<T>where
T: UnwindSafe + ?Sized,
Blanket Implementations§
source§impl<T, A> ArrayFromIterDtype<T> for Awhere
A: ParameterFreeDtypeStaticArray + ArrayFromIter<T>,
impl<T, A> ArrayFromIterDtype<T> for Awhere
A: ParameterFreeDtypeStaticArray + ArrayFromIter<T>,
fn arr_from_iter_with_dtype<I>(dtype: ArrowDataType, iter: I) -> Awhere
I: IntoIterator<Item = T>,
fn arr_from_iter_trusted_with_dtype<I>(dtype: ArrowDataType, iter: I) -> A
fn try_arr_from_iter_with_dtype<E, I>(
dtype: ArrowDataType,
iter: I,
) -> Result<A, E>where
I: IntoIterator<Item = Result<T, E>>,
fn try_arr_from_iter_trusted_with_dtype<E, I>( dtype: ArrowDataType, iter: I, ) -> Result<A, E>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default 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