pub struct MutableBinaryViewArray<T: ViewType + ?Sized> { /* private fields */ }
Implementations§
Source§impl<T: ViewType + ?Sized> MutableBinaryViewArray<T>
impl<T: ViewType + ?Sized> MutableBinaryViewArray<T>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
Sourcepub unsafe fn views_mut(&mut self) -> &mut Vec<View>
pub unsafe fn views_mut(&mut self) -> &mut Vec<View>
Get a mutable reference to the Vec
of View
s in this MutableBinaryViewArray
.
§Safety
This is safe as long as any mutation of the Vec
does not break any invariants of the
MutableBinaryViewArray
before it is read again.
Sourcepub unsafe fn set_total_bytes_len(&mut self, value: usize)
pub unsafe fn set_total_bytes_len(&mut self, value: usize)
Set the total_bytes_len
of the MutableBinaryViewArray
§Safety
This should not break invariants of the MutableBinaryViewArray
pub fn total_bytes_len(&self) -> usize
pub fn total_buffer_len(&self) -> usize
pub fn views(&self) -> &[View]
pub fn completed_buffers(&self) -> &[Buffer<u8>]
pub fn validity(&mut self) -> Option<&mut MutableBitmap>
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves additional
elements and additional_buffer
on the buffer.
pub fn len(&self) -> usize
pub fn capacity(&self) -> usize
Sourcepub unsafe fn push_view_unchecked_dedupe(
&mut self,
v: View,
buffers: &[Buffer<u8>],
)
pub unsafe fn push_view_unchecked_dedupe( &mut self, v: View, buffers: &[Buffer<u8>], )
§Safety
- caller must allocate enough capacity
- caller must ensure the view and buffers match.
- The array must not have validity.
- caller must not mix use this function with other push functions.
pub fn push_view(&mut self, v: View, buffers: &[Buffer<u8>])
pub fn push_value_ignore_validity<V: AsRef<T>>(&mut self, value: V)
pub fn push_buffer(&mut self, buffer: Buffer<u8>) -> u32
pub fn push_value<V: AsRef<T>>(&mut self, value: V)
pub fn push<V: AsRef<T>>(&mut self, value: Option<V>)
pub fn push_null(&mut self)
pub fn extend_null(&mut self, additional: usize)
pub fn extend_constant<V: AsRef<T>>( &mut self, additional: usize, value: Option<V>, )
Sourcepub fn with_validity(self, validity: Option<MutableBitmap>) -> Self
pub fn with_validity(self, validity: Option<MutableBitmap>) -> Self
Sourcepub fn set_validity(&mut self, validity: Option<MutableBitmap>)
pub fn set_validity(&mut self, validity: Option<MutableBitmap>)
Sourcepub fn apply_validity<F: FnOnce(MutableBitmap) -> MutableBitmap>(
&mut self,
f: F,
)
pub fn apply_validity<F: FnOnce(MutableBitmap) -> MutableBitmap>( &mut self, f: F, )
Applies a function f
to the validity of this array.
This is an API to leverage clone-on-write
§Panics
This function panics if the function f
modifies the length of the [Bitmap
].
pub fn extend_values<I, P>(&mut self, iterator: I)
pub fn extend_trusted_len_values<I, P>(&mut self, iterator: I)where
I: TrustedLen<Item = P>,
P: AsRef<T>,
pub fn extend<I, P>(&mut self, iterator: I)
pub fn extend_trusted_len<I, P>(&mut self, iterator: I)
pub fn extend_views<I>(&mut self, iterator: I, buffers: &[Buffer<u8>])
pub fn extend_views_trusted_len<I>( &mut self, iterator: I, buffers: &[Buffer<u8>], )
pub fn extend_non_null_views<I>(&mut self, iterator: I, buffers: &[Buffer<u8>])
pub fn extend_non_null_views_trusted_len<I>(
&mut self,
iterator: I,
buffers: &[Buffer<u8>],
)where
I: TrustedLen<Item = View>,
Sourcepub unsafe fn extend_non_null_views_unchecked<I>(
&mut self,
iterator: I,
buffers: &[Buffer<u8>],
)
pub unsafe fn extend_non_null_views_unchecked<I>( &mut self, iterator: I, buffers: &[Buffer<u8>], )
§Safety
Same as push_view_unchecked()
.
Sourcepub unsafe fn extend_non_null_views_unchecked_dedupe<I>(
&mut self,
iterator: I,
buffers: &[Buffer<u8>],
)
pub unsafe fn extend_non_null_views_unchecked_dedupe<I>( &mut self, iterator: I, buffers: &[Buffer<u8>], )
§Safety
Same as push_view_unchecked()
.
pub fn from_iterator<I, P>(iterator: I) -> Self
pub fn from_values_iter<I, P>(iterator: I) -> Self
pub fn from<S: AsRef<T>, P: AsRef<[Option<S>]>>(slice: P) -> Self
pub fn freeze(self) -> BinaryViewArrayGeneric<T>
pub fn freeze_with_dtype( self, dtype: ArrowDataType, ) -> BinaryViewArrayGeneric<T>
pub fn value(&self, i: usize) -> &T
Sourcepub unsafe fn value_unchecked(&self, i: usize) -> &T
pub unsafe fn value_unchecked(&self, i: usize) -> &T
Sourcepub unsafe fn value_from_view_unchecked<'a>(&'a self, view: &'a View) -> &'a T
pub unsafe fn value_from_view_unchecked<'a>(&'a self, view: &'a View) -> &'a T
Returns the element indicated by the given view.
§Safety
Assumes the View belongs to this MutableBinaryViewArray.
Sourcepub fn values_iter(&self) -> ArrayValuesIter<'_, MutableBinaryViewArray<T>> ⓘ
pub fn values_iter(&self) -> ArrayValuesIter<'_, MutableBinaryViewArray<T>> ⓘ
Returns an iterator of &[u8]
over every element of this array, ignoring the validity
Source§impl MutableBinaryViewArray<[u8]>
impl MutableBinaryViewArray<[u8]>
pub fn validate_utf8( &mut self, buffer_offset: usize, views_offset: usize, ) -> PolarsResult<()>
Sourcepub unsafe fn extend_from_lengths_with_stats(
&mut self,
buffer: &[u8],
lengths_iterator: impl Clone + ExactSizeIterator<Item = usize>,
min_length: usize,
max_length: usize,
sum_length: usize,
)
pub unsafe fn extend_from_lengths_with_stats( &mut self, buffer: &[u8], lengths_iterator: impl Clone + ExactSizeIterator<Item = usize>, min_length: usize, max_length: usize, sum_length: usize, )
Extend from a buffer
and length
of items given some statistics about the lengths.
This will attempt to dispatch to several optimized implementations.
§Safety
This is safe if the statistics are correct.
Sourcepub fn extend_from_lengths(
&mut self,
buffer: &[u8],
lengths_iterator: impl Clone + ExactSizeIterator<Item = usize>,
)
pub fn extend_from_lengths( &mut self, buffer: &[u8], lengths_iterator: impl Clone + ExactSizeIterator<Item = usize>, )
Extend from a buffer
and length
of items.
This will attempt to dispatch to several optimized implementations.
Trait Implementations§
Source§impl<'a, T: ViewType + ?Sized> ArrayAccessor<'a> for MutableBinaryViewArray<T>
impl<'a, T: ViewType + ?Sized> ArrayAccessor<'a> for MutableBinaryViewArray<T>
Source§impl<T: ViewType + ?Sized, P: AsRef<T>> Extend<Option<P>> for MutableBinaryViewArray<T>
impl<T: ViewType + ?Sized, P: AsRef<T>> Extend<Option<P>> for MutableBinaryViewArray<T>
Source§fn extend<I: IntoIterator<Item = Option<P>>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Option<P>>>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)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<T: ViewType + ?Sized, P: AsRef<T>> FromIterator<Option<P>> for MutableBinaryViewArray<T>
impl<T: ViewType + ?Sized, P: AsRef<T>> FromIterator<Option<P>> for MutableBinaryViewArray<T>
Source§impl<T: ViewType + ?Sized> MutableArray for MutableBinaryViewArray<T>
impl<T: ViewType + ?Sized> MutableArray for MutableBinaryViewArray<T>
Source§fn dtype(&self) -> &ArrowDataType
fn dtype(&self) -> &ArrowDataType
ArrowDataType
of the array.Source§fn validity(&self) -> Option<&MutableBitmap>
fn validity(&self) -> Option<&MutableBitmap>
Source§fn as_mut_any(&mut self) -> &mut dyn Any
fn as_mut_any(&mut self) -> &mut dyn Any
Any
, to enable dynamic casting.Source§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
Source§impl<T, K> Pushable<Option<T>> for MutableBinaryViewArray<K>
impl<T, K> Pushable<Option<T>> for MutableBinaryViewArray<K>
type Freeze = BinaryViewArrayGeneric<K>
fn reserve(&mut self, additional: usize)
fn push(&mut self, value: Option<T>)
fn len(&self) -> usize
fn push_null(&mut self)
fn extend_constant(&mut self, additional: usize, value: Option<T>)
fn extend_null_constant(&mut self, additional: usize)
fn freeze(self) -> Self::Freeze
fn with_capacity(capacity: usize) -> Self
fn extend_n(&mut self, n: usize, iter: impl Iterator<Item = T>)
Source§impl<T, K> Pushable<T> for MutableBinaryViewArray<K>
impl<T, K> Pushable<T> for MutableBinaryViewArray<K>
type Freeze = BinaryViewArrayGeneric<K>
fn reserve(&mut self, additional: usize)
fn push(&mut self, value: T)
fn len(&self) -> usize
fn push_null(&mut self)
fn extend_constant(&mut self, additional: usize, value: T)
fn extend_null_constant(&mut self, additional: usize)
fn freeze(self) -> Self::Freeze
fn with_capacity(capacity: usize) -> Self
fn extend_n(&mut self, n: usize, iter: impl Iterator<Item = T>)
Source§impl<T: ViewType + ?Sized, P: AsRef<T>> TryExtend<Option<P>> for MutableBinaryViewArray<T>
impl<T: ViewType + ?Sized, P: AsRef<T>> TryExtend<Option<P>> for MutableBinaryViewArray<T>
Source§fn try_extend<I: IntoIterator<Item = Option<P>>>(
&mut self,
iter: I,
) -> PolarsResult<()>
fn try_extend<I: IntoIterator<Item = Option<P>>>( &mut self, iter: I, ) -> PolarsResult<()>
This is infallible and is implemented for consistency with all other types
Auto Trait Implementations§
impl<T> Freeze for MutableBinaryViewArray<T>where
T: ?Sized,
impl<T> RefUnwindSafe for MutableBinaryViewArray<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for MutableBinaryViewArray<T>where
T: ?Sized,
impl<T> Sync for MutableBinaryViewArray<T>where
T: ?Sized,
impl<T> Unpin for MutableBinaryViewArray<T>
impl<T> UnwindSafe for MutableBinaryViewArray<T>where
T: UnwindSafe + ?Sized,
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