polars_arrow::legacy::trusted_len

Trait TrustedLenPush

Source
pub trait TrustedLenPush<T> {
    // Required methods
    unsafe fn push_unchecked(&mut self, value: T);
    unsafe fn extend_trusted_len_unchecked<I: IntoIterator<Item = T>>(
        &mut self,
        iter: I,
    );
    unsafe fn try_extend_trusted_len_unchecked<E, I: IntoIterator<Item = Result<T, E>>>(
        &mut self,
        iter: I,
    ) -> Result<(), E>;
    unsafe fn from_trusted_len_iter_unchecked<I: IntoIterator<Item = T>>(
        iter: I,
    ) -> Self;
    unsafe fn try_from_trusted_len_iter_unchecked<E, I: IntoIterator<Item = Result<T, E>>>(
        iter: I,
    ) -> Result<Self, E>
       where Self: Sized;

    // Provided methods
    fn extend_trusted_len<I: IntoIterator<Item = T, IntoIter = J>, J: TrustedLen>(
        &mut self,
        iter: I,
    ) { ... }
    fn from_trusted_len_iter<I: IntoIterator<Item = T, IntoIter = J>, J: TrustedLen>(
        iter: I,
    ) -> Self
       where Self: Sized { ... }
    fn try_from_trusted_len_iter<E, I: IntoIterator<Item = Result<T, E>, IntoIter = J>, J: TrustedLen>(
        iter: I,
    ) -> Result<Self, E>
       where Self: Sized { ... }
}

Required Methods§

Source

unsafe fn push_unchecked(&mut self, value: T)

Will push an item and not check if there is enough capacity.

§Safety

Caller must ensure the array has enough capacity to hold T.

Source

unsafe fn extend_trusted_len_unchecked<I: IntoIterator<Item = T>>( &mut self, iter: I, )

§Safety

Caller must ensure the iterators reported length is correct.

Source

unsafe fn try_extend_trusted_len_unchecked<E, I: IntoIterator<Item = Result<T, E>>>( &mut self, iter: I, ) -> Result<(), E>

§Safety

Caller must ensure the iterators reported length is correct.

Source

unsafe fn from_trusted_len_iter_unchecked<I: IntoIterator<Item = T>>( iter: I, ) -> Self

§Safety

Caller must ensure the iterators reported length is correct.

Source

unsafe fn try_from_trusted_len_iter_unchecked<E, I: IntoIterator<Item = Result<T, E>>>( iter: I, ) -> Result<Self, E>
where Self: Sized,

§Safety

Caller must ensure the iterators reported length is correct.

Provided Methods§

Source

fn extend_trusted_len<I: IntoIterator<Item = T, IntoIter = J>, J: TrustedLen>( &mut self, iter: I, )

Extend the array with an iterator who’s length can be trusted.

Source

fn from_trusted_len_iter<I: IntoIterator<Item = T, IntoIter = J>, J: TrustedLen>( iter: I, ) -> Self
where Self: Sized,

Source

fn try_from_trusted_len_iter<E, I: IntoIterator<Item = Result<T, E>, IntoIter = J>, J: TrustedLen>( iter: I, ) -> Result<Self, E>
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> TrustedLenPush<T> for Vec<T>

Source§

unsafe fn push_unchecked(&mut self, value: T)

Source§

unsafe fn extend_trusted_len_unchecked<I: IntoIterator<Item = T>>( &mut self, iter: I, )

Source§

unsafe fn try_extend_trusted_len_unchecked<E, I: IntoIterator<Item = Result<T, E>>>( &mut self, iter: I, ) -> Result<(), E>

Source§

unsafe fn from_trusted_len_iter_unchecked<I: IntoIterator<Item = T>>( iter: I, ) -> Self

Source§

unsafe fn try_from_trusted_len_iter_unchecked<E, I: IntoIterator<Item = Result<T, E>>>( iter: I, ) -> Result<Self, E>
where Self: Sized,

Implementors§