[][src]Struct polars::chunked_array::builder::AlignedVec

pub struct AlignedVec<T> { /* fields omitted */ }

A Vec wrapper with a memory alignment equal to Arrow's primitive arrays. Can be useful in creating a new ChunkedArray or Arrow Primitive array without copying.

Implementations

impl<T: Clone> AlignedVec<T>[src]

pub fn resize(&mut self, new_len: usize, value: T)[src]

pub fn extend_from_slice(&mut self, other: &[T])[src]

impl<T> AlignedVec<T>[src]

pub fn with_capacity_aligned(size: usize) -> Self[src]

Create a new Vec where first bytes memory address has an alignment of 64 bytes, as described by arrow spec. Read more: https://github.com/rust-ndarray/ndarray/issues/771

pub fn is_empty(&self) -> bool[src]

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

pub fn len(&self) -> usize[src]

pub unsafe fn from_ptr(ptr: usize, len: usize, capacity: usize) -> Self[src]

Create a new aligned vec from a ptr.

Safety

The ptr should be 64 byte aligned and len and capacity should be correct otherwise it is UB.

pub fn push(&mut self, value: T)[src]

Push at the end of the Vec. This is unsafe because a push when the capacity of the inner Vec is reached will reallocate the Vec without the alignment, leaving this destructor's alignment incorrect

pub unsafe fn set_len(&mut self, new_len: usize)[src]

Set the length of the underlying Vec.

Safety

  • new_len must be less than or equal to capacity.
  • The elements at old_len..new_len must be initialized.

pub fn as_ptr(&self) -> *const T[src]

pub fn as_mut_ptr(&mut self) -> *mut T[src]

pub fn capacity(&self) -> usize[src]

pub fn into_raw_parts(self) -> (*mut T, usize, usize)[src]

pub fn shrink_to_fit(&mut self)[src]

pub fn into_arrow_buffer(self) -> Buffer[src]

Transform this array to an Arrow Buffer.

Trait Implementations

impl<T: Debug> Debug for AlignedVec<T>[src]

impl<T> Drop for AlignedVec<T>[src]

impl<T> FromIterator<T> for AlignedVec<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for AlignedVec<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for AlignedVec<T> where
    T: Send
[src]

impl<T> Sync for AlignedVec<T> where
    T: Sync
[src]

impl<T> Unpin for AlignedVec<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for AlignedVec<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> From<T> for T[src]

impl<T> FromCast<T> for T

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,