fn flat_map_iter<O, SI>(self, operation: O) -> FlatMapIter<Self, O>
    where
        O: Fn(Self::Item) -> SI + Clone + Send + 'a,
        SI: IntoIterator,
        SI::Item: Send,
    {
        FlatMapIter::new(self, operation)
    }
/// Applies `operation` to each item of this iterator to get nested serial iterators,
/// producing a new parallel iterator that flattens these back into one.
///
/// # `flat_map_iter` versus `flat_map`
///
/// These two methods are similar but behave slightly differently. With [`flat_map`],
/// each of the nested iterators must be a parallel iterator, and they will be further
/// split up with nested parallelism. With `flat_map_iter`, each nested iterator is a
/// sequential `Iterator`, and we only parallelize _between_ them, while the items
/// produced by each nested iterator are processed sequentially.
///
/// When choosing between these methods, consider whether nested parallelism suits the
/// potential iterators at hand. If there's little computation involved, or its length
/// is much less than the outer parallel iterator, then it may perform better to avoid
/// the overhead of parallelism, just flattening sequentially with `flat_map_iter`.
/// If there is a lot of computation, potentially outweighing the outer parallel
/// iterator, then the nested parallelism of `flat_map` may be worthwhile.
///
/// [`flat_map`]: #method.flat_map
///
/// # Examples
///
/// ```
/// use asparit::*;
/// use std::cell::RefCell;
///
/// let a = [[1, 2], [3, 4], [5, 6], [7, 8]];
///
/// let par_iter = a.par_iter().flat_map_iter(|a| {
///     // The serial iterator doesn't have to be thread-safe, just its items.
///     let cell_iter = RefCell::new(a.iter().cloned());
///     std::iter::from_fn(move || cell_iter.borrow_mut().next())
/// });
///
/// let vec: Vec<_> = par_iter.collect().exec();
///
/// assert_eq!(&vec[..], &[1, 2, 3, 4, 5, 6, 7, 8]);
/// ```
Applies `operation` to each item of this iterator to get nested serial iterators,
producing a new parallel iterator that flattens these back into one.
Applies ` operation ` to each item of this iterator to get nested serial iterators producing a new parallel iterator that flattens these back into one .
fn flat_map_iter<O, SI>(self, operation: O) -> FlatMapIter<Self, O>
    where
        O: Fn(Self::Item) -> SI + Clone + Send + 'a,
        SI: IntoIterator,
        SI::Item: Send,
    {
        FlatMapIter::new(self, operation)
    }
fn flat_map_iter < O , SI > ( self , operation : O ) -> FlatMapIter < Self , O > where O : Fn ( Self :: Item ) -> SI + Clone + Send + ' a , SI : IntoIterator , SI :: Item : Send , { FlatMapIter :: new ( self , operation ) }
Applies `operation` to each item of this iterator to get nested serial iterators,
producing a new parallel iterator that flattens these back into one.
Applies ` operation ` to each item of this iterator to get nested serial iterators producing a new parallel iterator that flattens these back into one .
self
operation
O
self
operation
O
`flat_map_iter` versus `flat_map`
These two methods are similar but behave slightly differently. With [`flat_map`],
each of the nested iterators must be a parallel iterator, and they will be further
split up with nested parallelism. With `flat_map_iter`, each nested iterator is a
sequential `Iterator`, and we only parallelize _between_ them, while the items
produced by each nested iterator are processed sequentially.

When choosing between these methods, consider whether nested parallelism suits the
potential iterators at hand. If there's little computation involved, or its length
is much less than the outer parallel iterator, then it may perform better to avoid
the overhead of parallelism, just flattening sequentially with `flat_map_iter`.
If there is a lot of computation, potentially outweighing the outer parallel
iterator, then the nested parallelism of `flat_map` may be worthwhile.

[`flat_map`]: #method.flat_map
These two methods are similar but behave slightly differently . With [ ` flat_map ` ] each of the nested iterators must be a parallel iterator and they will be further split up with nested parallelism . With ` flat_map_iter ` each nested iterator is a sequential ` Iterator ` and we only parallelize _between_ them while the items produced by each nested iterator are processed sequentially . When choosing between these methods consider whether nested parallelism suits the potential iterators at hand . If there ' s little computation involved or its length is much less than the outer parallel iterator then it may perform better to avoid the overhead of parallelism just flattening sequentially with ` flat_map_iter ` . If there is a lot of computation potentially outweighing the outer parallel iterator then the nested parallelism of ` flat_map ` may be worthwhile . [ ` flat_map ` ] : #method . flat_map
examples
```
use asparit::*;
use std::cell::RefCell.



let par_iter = a.par_iter().flat_map_iter(|a| {
The serial iterator doesn't have to be thread-safe, just its items.
let cell_iter = RefCell::new(a.iter().cloned());
std::iter::from_fn(move || cell_iter.borrow_mut().next())
}).

let vec: Vec<_> = par_iter.collect().exec().


` ` ` use asparit :: * ; use std :: cell :: RefCell . let par_iter = a . par_iter () . flat_map_iter ( |a| { The serial iterator doesn ' t have to be thread - safe just its items . let cell_iter = RefCell :: new ( a . iter () . cloned () ) ; std :: iter :: from_fn ( move || cell_iter . borrow_mut () . next () ) } ) . let vec : Vec<_ > = par_iter . collect () . exec () .