///
/// 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 .
async fn generate(
    context: Context,
    params: Params,
    entry: Arc<rule_graph::Entry<Rule>>,
    generator: Value,
  ) -> NodeResult<Value> {
    let mut input = Value::from(externs::none());
    loop {
      let context = context.clone();
      let params = params.clone();
      let entry = entry.clone();
      match externs::generator_send(&generator, &input)? {
        externs::GeneratorResponse::Get(get) => {
          let values = Self::gen_get(&context, &params, &entry, vec![get]).await?;
          input = values.into_iter().next().unwrap();
        }
        externs::GeneratorResponse::GetMulti(gets) => {
          let values = Self::gen_get(&context, &params, &entry, gets).await?;
          input = externs::store_tuple(values);
        }
        externs::GeneratorResponse::Break(val) => {
          break Ok(val);
        }
      }
    }
  }
async fn generate ( context : Context , params : Params , entry : Arc < rule_graph :: Entry < Rule > > , generator : Value , ) -> NodeResult < Value > { let mut input = Value :: from ( externs :: none ( ) ) ; loop { let context = context . clone ( ) ; let params = params . clone ( ) ; let entry = entry . clone ( ) ; match externs :: generator_send ( & generator , & input ) ? { externs :: GeneratorResponse :: Get ( get ) => { let values = Self :: gen_get ( & context , & params , & entry , vec ! [ get ] ) . await ? ; input = values . into_iter ( ) . next ( ) . unwrap ( ) ; } externs :: GeneratorResponse :: GetMulti ( gets ) => { let values = Self :: gen_get ( & context , & params , & entry , gets ) . await ? ; input = externs :: store_tuple ( values ) ; } externs :: GeneratorResponse :: Break ( val ) => { break Ok ( val ) ; } } } }
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<Rule>>
generator
Value