polars_arrow::array

Struct MutableBinaryViewArray

Source
pub struct MutableBinaryViewArray<T: ViewType + ?Sized> { /* private fields */ }

Implementations§

Source§

impl<T: ViewType + ?Sized> MutableBinaryViewArray<T>

Source

pub fn new() -> Self

Source

pub fn with_capacity(capacity: usize) -> Self

Source

pub unsafe fn views_mut(&mut self) -> &mut Vec<View>

Get a mutable reference to the Vec of Views 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.

Source

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

Source

pub fn total_bytes_len(&self) -> usize

Source

pub fn total_buffer_len(&self) -> usize

Source

pub fn views(&self) -> &[View]

Source

pub fn completed_buffers(&self) -> &[Buffer<u8>]

Source

pub fn validity(&mut self) -> Option<&mut MutableBitmap>

Source

pub fn reserve(&mut self, additional: usize)

Reserves additional elements and additional_buffer on the buffer.

Source

pub fn len(&self) -> usize

Source

pub fn capacity(&self) -> usize

Source

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.
Source

pub fn push_view(&mut self, v: View, buffers: &[Buffer<u8>])

Source

pub fn push_value_ignore_validity<V: AsRef<T>>(&mut self, value: V)

Source

pub fn push_buffer(&mut self, buffer: Buffer<u8>) -> u32

Source

pub fn push_value<V: AsRef<T>>(&mut self, value: V)

Source

pub fn push<V: AsRef<T>>(&mut self, value: Option<V>)

Source

pub fn push_null(&mut self)

Source

pub fn extend_null(&mut self, additional: usize)

Source

pub fn extend_constant<V: AsRef<T>>( &mut self, additional: usize, value: Option<V>, )

Source

pub fn with_validity(self, validity: Option<MutableBitmap>) -> Self

Returns this array with a new validity.

§Panic

Panics iff validity.len() != self.len().

Source

pub fn set_validity(&mut self, validity: Option<MutableBitmap>)

Sets the validity of this array.

§Panics

This function panics iff values.len() != self.len().

Source

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].

Source

pub fn extend_values<I, P>(&mut self, iterator: I)
where I: Iterator<Item = P>, P: AsRef<T>,

Source

pub fn extend_trusted_len_values<I, P>(&mut self, iterator: I)
where I: TrustedLen<Item = P>, P: AsRef<T>,

Source

pub fn extend<I, P>(&mut self, iterator: I)
where I: Iterator<Item = Option<P>>, P: AsRef<T>,

Source

pub fn extend_trusted_len<I, P>(&mut self, iterator: I)
where I: TrustedLen<Item = Option<P>>, P: AsRef<T>,

Source

pub fn extend_views<I>(&mut self, iterator: I, buffers: &[Buffer<u8>])
where I: Iterator<Item = Option<View>>,

Source

pub fn extend_views_trusted_len<I>( &mut self, iterator: I, buffers: &[Buffer<u8>], )
where I: TrustedLen<Item = Option<View>>,

Source

pub fn extend_non_null_views<I>(&mut self, iterator: I, buffers: &[Buffer<u8>])
where I: Iterator<Item = View>,

Source

pub fn extend_non_null_views_trusted_len<I>( &mut self, iterator: I, buffers: &[Buffer<u8>], )
where I: TrustedLen<Item = View>,

Source

pub unsafe fn extend_non_null_views_unchecked<I>( &mut self, iterator: I, buffers: &[Buffer<u8>], )
where I: Iterator<Item = View>,

§Safety

Same as push_view_unchecked().

Source

pub unsafe fn extend_non_null_views_unchecked_dedupe<I>( &mut self, iterator: I, buffers: &[Buffer<u8>], )
where I: Iterator<Item = View>,

§Safety

Same as push_view_unchecked().

Source

pub fn from_iterator<I, P>(iterator: I) -> Self
where I: Iterator<Item = Option<P>>, P: AsRef<T>,

Source

pub fn from_values_iter<I, P>(iterator: I) -> Self
where I: Iterator<Item = P>, P: AsRef<T>,

Source

pub fn from<S: AsRef<T>, P: AsRef<[Option<S>]>>(slice: P) -> Self

Source

pub fn freeze(self) -> BinaryViewArrayGeneric<T>

Source

pub fn freeze_with_dtype( self, dtype: ArrowDataType, ) -> BinaryViewArrayGeneric<T>

Source

pub fn value(&self, i: usize) -> &T

Source

pub unsafe fn value_unchecked(&self, i: usize) -> &T

Returns the element at index i

§Safety

Assumes that the i < self.len.

Source

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.

Source

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]>

Source

pub fn validate_utf8( &mut self, buffer_offset: usize, views_offset: usize, ) -> PolarsResult<()>

Source

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.

Source

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>

Source§

type Item = &'a T

Source§

unsafe fn value_unchecked(&'a self, index: usize) -> Self::Item

Safety Read more
Source§

fn len(&self) -> usize

Source§

impl<T: ViewType + ?Sized> Clone for MutableBinaryViewArray<T>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: ViewType + ?Sized> Debug for MutableBinaryViewArray<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: ViewType + ?Sized> Default for MutableBinaryViewArray<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

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)

Extends a collection with the contents of an iterator. Read more
Source§

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)

🔬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>

Source§

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>

Source§

fn from_iter<I: IntoIterator<Item = Option<P>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<T: ViewType + ?Sized> MutableArray for MutableBinaryViewArray<T>

Source§

fn dtype(&self) -> &ArrowDataType

The ArrowDataType of the array.
Source§

fn len(&self) -> usize

The length of the array.
Source§

fn validity(&self) -> Option<&MutableBitmap>

The optional validity of the array.
Source§

fn as_box(&mut self) -> Box<dyn Array>

Convert itself to an (immutable) Array.
Source§

fn as_any(&self) -> &dyn Any

Convert to Any, to enable dynamic casting.
Source§

fn as_mut_any(&mut self) -> &mut dyn Any

Convert to mutable Any, to enable dynamic casting.
Source§

fn push_null(&mut self)

Adds a new null element to the array.
Source§

fn reserve(&mut self, additional: usize)

Reserves additional slots to its capacity.
Source§

fn shrink_to_fit(&mut self)

Shrink the array to fit its length.
Source§

fn is_empty(&self) -> bool

Whether the array is empty.
Source§

fn as_arc(&mut self) -> Arc<dyn Array>

Convert itself to an (immutable) atomically reference counted Array.
Source§

fn is_valid(&self, index: usize) -> bool

Whether index is valid / set. Read more
Source§

impl<T, K> Pushable<Option<T>> for MutableBinaryViewArray<K>
where T: AsRef<K>, K: ViewType + ?Sized,

Source§

type Freeze = BinaryViewArrayGeneric<K>

Source§

fn reserve(&mut self, additional: usize)

Source§

fn push(&mut self, value: Option<T>)

Source§

fn len(&self) -> usize

Source§

fn push_null(&mut self)

Source§

fn extend_constant(&mut self, additional: usize, value: Option<T>)

Source§

fn extend_null_constant(&mut self, additional: usize)

Source§

fn freeze(self) -> Self::Freeze

Source§

fn with_capacity(capacity: usize) -> Self

Source§

fn extend_n(&mut self, n: usize, iter: impl Iterator<Item = T>)

Source§

impl<T, K> Pushable<T> for MutableBinaryViewArray<K>
where T: AsRef<K> + NoOption, K: ViewType + ?Sized,

Source§

type Freeze = BinaryViewArrayGeneric<K>

Source§

fn reserve(&mut self, additional: usize)

Source§

fn push(&mut self, value: T)

Source§

fn len(&self) -> usize

Source§

fn push_null(&mut self)

Source§

fn extend_constant(&mut self, additional: usize, value: T)

Source§

fn extend_null_constant(&mut self, additional: usize)

Source§

fn freeze(self) -> Self::Freeze

Source§

fn with_capacity(capacity: usize) -> Self

Source§

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>

Source§

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

Source§

impl<T: ViewType + ?Sized, P: AsRef<T>> TryPush<Option<P>> for MutableBinaryViewArray<T>

Source§

fn try_push(&mut self, item: Option<P>) -> 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>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for MutableBinaryViewArray<T>
where T: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.