fn generate(
    context: Context,
    params: Params,
    entry: Arc<rule_graph::Entry>,
    generator: Value,
  ) -> NodeFuture<Value> {
    future::loop_fn(externs::eval("None").unwrap(), move |input| {
      let context = context.clone();
      let params = params.clone();
      let entry = entry.clone();
      future::result(externs::generator_send(&generator, &input)).and_then(move |response| {
        match response {
          externs::GeneratorResponse::Get(get) => {
            Self::gen_get(&context, &params, &entry, vec![get])
              .map(|vs| future::Loop::Continue(vs.into_iter().next().unwrap()))
              .to_boxed()
          }
          externs::GeneratorResponse::GetMulti(gets) => {
            Self::gen_get(&context, &params, &entry, gets)
              .map(|vs| future::Loop::Continue(externs::store_tuple(&vs)))
              .to_boxed()
          }
          externs::GeneratorResponse::Break(val) => future::ok(future::Loop::Break(val)).to_boxed(),
        }
      })
    })
    .to_boxed()
  }
///
/// Given a python generator Value, loop to request the generator's dependencies until
/// it completes with a result Value.
///
Given a python generator Value, loop to request the generator's dependencies until
it completes with a result Value.
Given a python generator Value loop to request the generator ' s dependencies until it completes with a result Value .
fn generate(
    context: Context,
    params: Params,
    entry: Arc<rule_graph::Entry>,
    generator: Value,
  ) -> NodeFuture<Value> {
    future::loop_fn(externs::eval("None").unwrap(), move |input| {
      let context = context.clone();
      let params = params.clone();
      let entry = entry.clone();
      future::result(externs::generator_send(&generator, &input)).and_then(move |response| {
        match response {
          externs::GeneratorResponse::Get(get) => {
            Self::gen_get(&context, &params, &entry, vec![get])
              .map(|vs| future::Loop::Continue(vs.into_iter().next().unwrap()))
              .to_boxed()
          }
          externs::GeneratorResponse::GetMulti(gets) => {
            Self::gen_get(&context, &params, &entry, gets)
              .map(|vs| future::Loop::Continue(externs::store_tuple(&vs)))
              .to_boxed()
          }
          externs::GeneratorResponse::Break(val) => future::ok(future::Loop::Break(val)).to_boxed(),
        }
      })
    })
    .to_boxed()
  }
fn generate ( context : Context , params : Params , entry : Arc < rule_graph :: Entry > , generator : Value , ) -> NodeFuture < Value > { future :: loop_fn ( externs :: eval ( " " ) . unwrap ( ) , move | input | { let context = context . clone ( ) ; let params = params . clone ( ) ; let entry = entry . clone ( ) ; future :: result ( externs :: generator_send ( & generator , & input ) ) . and_then ( move | response | { match response { externs :: GeneratorResponse :: Get ( get ) => { Self :: gen_get ( & context , & params , & entry , vec ! [ get ] ) . map ( | vs | future :: Loop :: Continue ( vs . into_iter ( ) . next ( ) . unwrap ( ) ) ) . to_boxed ( ) } externs :: GeneratorResponse :: GetMulti ( gets ) => { Self :: gen_get ( & context , & params , & entry , gets ) . map ( | vs | future :: Loop :: Continue ( externs :: store_tuple ( & vs ) ) ) . to_boxed ( ) } externs :: GeneratorResponse :: Break ( val ) => future :: ok ( future :: Loop :: Break ( val ) ) . to_boxed ( ) , } } ) } ) . to_boxed ( ) }
Given a python generator Value, loop to request the generator's dependencies until
it completes with a result Value.
Given a python generator Value loop to request the generator ' s dependencies until it completes with a result Value .
context
Context
params
Params
entry
Arc<rule_graph::Entry>
generator
Value