polars_core::utils

Trait CustomIterTools

pub trait CustomIterTools: Iterator {
    // Provided methods
    unsafe fn trust_my_length(
        self,
        length: usize,
    ) -> TrustMyLength<Self, Self::Item> 
       where Self: Sized { ... }
    fn collect_trusted<T>(self) -> T
       where T: FromTrustedLenIterator<Self::Item>,
             Self: Sized + TrustedLen { ... }
    fn collect_reversed<T>(self) -> T
       where T: FromIteratorReversed<Self::Item>,
             Self: Sized + TrustedLen { ... }
}

Provided Methods§

unsafe fn trust_my_length( self, length: usize, ) -> TrustMyLength<Self, Self::Item>
where Self: Sized,

Turn any iterator in a trusted length iterator

§Safety

The given length must be correct.

fn collect_trusted<T>(self) -> T
where T: FromTrustedLenIterator<Self::Item>, Self: Sized + TrustedLen,

fn collect_reversed<T>(self) -> T
where T: FromIteratorReversed<Self::Item>, Self: Sized + TrustedLen,

Implementors§

§

impl<T> CustomIterTools for T
where T: Iterator + ?Sized,