pub fn flat_map<I, C, L>(
        &self,
        key: Option<Row>,
        constructor: C,
    ) -> (
        timely::dataflow::Stream<S, I::Item>,
        Collection<S, DataflowError, Diff>,
    )
    where
        I: IntoIterator,
        I::Item: Data,
        C: FnOnce(Option<Permutation>) -> L,
        L: for<'a, 'b> FnMut(&'a [&'b RefOrMut<'b, Row>], &'a S::Timestamp, &'a Diff) -> I
            + 'static,
    {
        // Set a number of tuples after which the operator should yield.
        // This allows us to remain responsive even when enumerating a substantial
        // arrangement, as well as provides time to accumulate our produced output.
        let refuel = 1000000;

        match &self {
            ArrangementFlavor::Local(oks, errs, permutation) => {
                let mut logic = constructor(Some(permutation.clone()));
                let oks = CollectionBundle::<S, Row, T>::flat_map_core(
                    &oks,
                    key,
                    move |k, v, t, d| logic(&[&k, &v], t, d),
                    refuel,
                );
                let errs = errs.as_collection(|k, &()| k.clone());
                return (oks, errs);
            }
            ArrangementFlavor::Trace(_, oks, errs, permutation) => {
                let mut logic = constructor(Some(permutation.clone()));
                let oks = CollectionBundle::<S, Row, T>::flat_map_core(
                    &oks,
                    key,
                    move |k, v, t, d| logic(&[&k, &v], t, d),
                    refuel,
                );
                let errs = errs.as_collection(|k, &()| k.clone());
                return (oks, errs);
            }
        }
    }
/// Constructs and applies logic to elements of `self` and returns the results.
///
/// `constructor` takes a permutation and produces the logic to apply on elements. The logic
/// conceptually receives `(&Row, &Row)` pairs in the form of a slice. Only after borrowing
/// the elements and applying the permutation the datums will be in the expected order.
///
/// If `key` is set, this is a promise that `logic` will produce no results on
/// records for which the key does not evaluate to the value. This is used to
/// leap directly to exactly those records.
Constructs and applies logic to elements of `self` and returns the results.
`constructor` takes a permutation and produces the logic to apply on elements. The logic
conceptually receives `(&Row, &Row)` pairs in the form of a slice. Only after borrowing
the elements and applying the permutation the datums will be in the expected order.

If `key` is set, this is a promise that `logic` will produce no results on
records for which the key does not evaluate to the value. This is used to
leap directly to exactly those records.
Constructs and applies logic to elements of ` self ` and returns the results . ` constructor ` takes a permutation and produces the logic to apply on elements . The logic conceptually receives ` ( &Row &Row ) ` pairs in the form of a slice . Only after borrowing the elements and applying the permutation the datums will be in the expected order . If ` key ` is set this is a promise that ` logic ` will produce no results on records for which the key does not evaluate to the value . This is used to leap directly to exactly those records .
pub fn flat_map<I, C, L>(
        &self,
        key: Option<Row>,
        constructor: C,
    ) -> (
        timely::dataflow::Stream<S, I::Item>,
        Collection<S, DataflowError, Diff>,
    )
    where
        I: IntoIterator,
        I::Item: Data,
        C: FnOnce(Option<Permutation>) -> L,
        L: for<'a, 'b> FnMut(&'a [&'b RefOrMut<'b, Row>], &'a S::Timestamp, &'a Diff) -> I
            + 'static,
    {
        // Set a number of tuples after which the operator should yield.
        // This allows us to remain responsive even when enumerating a substantial
        // arrangement, as well as provides time to accumulate our produced output.
        let refuel = 1000000;
        match &self {
            ArrangementFlavor::Local(oks, errs, permutation) => {
                let mut logic = constructor(Some(permutation.clone()));
                let oks = CollectionBundle::<S, Row, T>::flat_map_core(
                    &oks,
                    key,
                    move |k, v, t, d| logic(&[&k, &v], t, d),
                    refuel,
                );
                let errs = errs.as_collection(|k, &()| k.clone());
                return (oks, errs);
            }
            ArrangementFlavor::Trace(_, oks, errs, permutation) => {
                let mut logic = constructor(Some(permutation.clone()));
                let oks = CollectionBundle::<S, Row, T>::flat_map_core(
                    &oks,
                    key,
                    move |k, v, t, d| logic(&[&k, &v], t, d),
                    refuel,
                );
                let errs = errs.as_collection(|k, &()| k.clone());
                return (oks, errs);
            }
        }
    }
pub fn flat_map < I , C , L > ( & self , key : Option < Row > , constructor : C , ) -> ( timely :: dataflow :: Stream < S , I :: Item > , Collection < S , DataflowError , Diff > , ) where I : IntoIterator , I :: Item : Data , C : FnOnce ( Option < Permutation > ) -> L , L : for < ' a , ' b > FnMut ( & ' a [ & ' b RefOrMut < ' b , Row > ] , & ' a S :: Timestamp , & ' a Diff ) -> I + ' static , { // Set a number of tuples after which the operator should yield. // This allows us to remain responsive even when enumerating a substantial // arrangement, as well as provides time to accumulate our produced output. let refuel = 1000000 ; match & self { ArrangementFlavor :: Local ( oks , errs , permutation ) => { let mut logic = constructor ( Some ( permutation . clone ( ) ) ) ; let oks = CollectionBundle :: < S , Row , T > :: flat_map_core ( & oks , key , move | k , v , t , d | logic ( & [ & k , & v ] , t , d ) , refuel , ) ; let errs = errs . as_collection ( | k , & ( ) | k . clone ( ) ) ; return ( oks , errs ) ; } ArrangementFlavor :: Trace ( _ , oks , errs , permutation ) => { let mut logic = constructor ( Some ( permutation . clone ( ) ) ) ; let oks = CollectionBundle :: < S , Row , T > :: flat_map_core ( & oks , key , move | k , v , t , d | logic ( & [ & k , & v ] , t , d ) , refuel , ) ; let errs = errs . as_collection ( | k , & ( ) | k . clone ( ) ) ; return ( oks , errs ) ; } } }
Constructs and applies logic to elements of `self` and returns the results.
Constructs and applies logic to elements of ` self ` and returns the results .
&self
key
Option<Row>
constructor
C
&self
key
Option<Row>
constructor
C