pub trait IterExtensions: Iterator {
// Provided methods
fn reusable_format(self, sep: &str) -> ReusableIterFormat<'_, Self>
where Self: Sized { ... }
fn rle_cumulative(self) -> impl Iterator<Item = (usize, Self::Item)>
where Self: Sized,
Self::Item: PartialEq { ... }
}Expand description
Format all iterator elements, separated by sep.
Unlike the underlying itertools::format, does not panic if fmt is called more than once.
Should be used for logging purposes since itertools::format will panic when used by multiple loggers.
Provided Methods§
fn reusable_format(self, sep: &str) -> ReusableIterFormat<'_, Self>where
Self: Sized,
Sourcefn rle_cumulative(self) -> impl Iterator<Item = (usize, Self::Item)>
fn rle_cumulative(self) -> impl Iterator<Item = (usize, Self::Item)>
Provides a run-length-encoding iterator that yields the cumulative count of elements seen so far, along with the value of the element. Useful for creating compressed representations of sequences with repeating elements
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".