Skip to main content

Itertools

Trait Itertools 

Source
pub trait Itertools: Iterator {
    // Provided methods
    fn collect_vec(self) -> Vec<Self::Item>
       where Self: Sized { ... }
    fn try_collect<T, U, E>(self) -> Result<U, E>
       where Self: Sized + Iterator<Item = Result<T, E>>,
             Result<U, E>: FromIterator<Result<T, E>> { ... }
    fn try_collect_vec<T, U, E>(self) -> Result<Vec<U>, E>
       where Self: Sized + Iterator<Item = Result<T, E>>,
             Result<Vec<U>, E>: FromIterator<Result<T, E>> { ... }
    fn enumerate_idx(self) -> EnumerateIdx<Self, IdxSize> 
       where Self: Sized { ... }
    fn enumerate_u32(self) -> EnumerateIdx<Self, u32> 
       where Self: Sized { ... }
    fn all_equal(self) -> bool
       where Self: Sized,
             Self::Item: PartialEq { ... }
    fn eq_by_<I, F>(self, other: I, eq: F) -> bool
       where Self: Sized,
             I: IntoIterator,
             F: FnMut(Self::Item, I::Item) -> bool { ... }
    fn partial_cmp_by_<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
       where Self: Sized,
             I: IntoIterator,
             F: FnMut(Self::Item, I::Item) -> Option<Ordering> { ... }
    fn join(&mut self, sep: &str) -> String
       where Self::Item: Display { ... }
    fn zip_eq<I>(self, other: I) -> ZipEq<Self, I::IntoIter> 
       where Self: Sized,
             I: IntoIterator { ... }
}
Expand description

Utility extension trait of iterator methods.

Provided Methods§

Source

fn collect_vec(self) -> Vec<Self::Item>
where Self: Sized,

Equivalent to .collect::<Vec<_>>().

Source

fn try_collect<T, U, E>(self) -> Result<U, E>
where Self: Sized + Iterator<Item = Result<T, E>>, Result<U, E>: FromIterator<Result<T, E>>,

Equivalent to .collect::<Result<_, _>>().

Source

fn try_collect_vec<T, U, E>(self) -> Result<Vec<U>, E>
where Self: Sized + Iterator<Item = Result<T, E>>, Result<Vec<U>, E>: FromIterator<Result<T, E>>,

Equivalent to .collect::<Result<Vec<_>, _>>().

Source

fn enumerate_idx(self) -> EnumerateIdx<Self, IdxSize>
where Self: Sized,

Source

fn enumerate_u32(self) -> EnumerateIdx<Self, u32>
where Self: Sized,

Source

fn all_equal(self) -> bool
where Self: Sized, Self::Item: PartialEq,

Source

fn eq_by_<I, F>(self, other: I, eq: F) -> bool
where Self: Sized, I: IntoIterator, F: FnMut(Self::Item, I::Item) -> bool,

Source

fn partial_cmp_by_<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where Self: Sized, I: IntoIterator, F: FnMut(Self::Item, I::Item) -> Option<Ordering>,

Source

fn join(&mut self, sep: &str) -> String
where Self::Item: Display,

Source

fn zip_eq<I>(self, other: I) -> ZipEq<Self, I::IntoIter>
where Self: Sized, I: IntoIterator,

Zips two iterators but panics if they are not of the same length.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Iterator + ?Sized> Itertools for T