Struct polars_arrow::array::MutableBinaryViewArray
source · 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
pub fn views_mut(&mut self) -> &mut Vec<View>
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(&mut self, v: View, buffers: &[Buffer<u8>])
pub unsafe fn push_view(&mut self, v: View, buffers: &[Buffer<u8>])
§Safety
- caller must allocate enough capacity
- caller must ensure the view and buffers match.
pub fn push_value_ignore_validity<V: AsRef<T>>(&mut self, value: V)
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 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 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<()>
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)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
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
Converts to this type from the input type.
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 data_type(&self) -> &ArrowDataType
fn data_type(&self) -> &ArrowDataType
The
ArrowDataType
of the array.source§fn validity(&self) -> Option<&MutableBitmap>
fn validity(&self) -> Option<&MutableBitmap>
The optional validity of the array.
source§fn as_mut_any(&mut self) -> &mut dyn Any
fn as_mut_any(&mut self) -> &mut dyn Any
Convert to mutable
Any
, to enable dynamic casting.source§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
Shrink the array to fit its length.
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
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
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<A, T, E> FromFallibleIterator<A, E> for Twhere
T: FromIterator<A>,
E: Error,
impl<A, T, E> FromFallibleIterator<A, E> for Twhere
T: FromIterator<A>,
E: Error,
fn from_fallible_iter<F>(iter: F) -> Result<T, E>where
F: FallibleIterator<E, Item = A>,
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> ⓘ
Converts
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> ⓘ
Converts
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