[−][src]Struct polars::chunked_array::builder::AlignedVec
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 tocapacity
.- 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]
pub fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for AlignedVec<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for AlignedVec<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for AlignedVec<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for AlignedVec<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for AlignedVec<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
U: FromCast<T>,
pub fn cast(self) -> U
impl<T> From<T> for T
[src]
impl<T> FromCast<T> for T
pub fn from_cast(t: T) -> T
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,