Trait iterextd::TupleIntoIter
source · pub trait TupleIntoIter<T, const N: usize> {
// Required method
fn tuple_into_iter(self) -> IntoIter<T, N>;
}
Expand description
Tuple iterator, adds the ability to get elements by value.
Required Methods§
sourcefn tuple_into_iter(self) -> IntoIter<T, N>
fn tuple_into_iter(self) -> IntoIter<T, N>
Creates an iterator from a tuple that returns elements by value.
§Examples
Basic usage:
use iterextd::{TupleIter, TupleIntoIter};
let tup = ((1, 2, 3), (4, 5, 6), (7, 8, 9));
let iter = tup.tuple_iter();
let vec = iter.flat_map(|elem|{ elem.tuple_into_iter() }).collect::<Vec<_>>();
assert_eq!(vec, [1, 2, 3, 4, 5, 6, 7, 8, 9]);