fn gen_nodes(&self, context: &Context) -> Vec<NodeFuture<Value>> {
    // TODO: These `product==` hooks are hacky.
    if self.product() == &context.core.types.snapshot {
      // If the requested product is a Snapshot, execute a Snapshot Node and then lower to a Value
      // for this caller.
      let context = context.clone();
      vec![
        self
          .get_snapshot(&context)
          .map(move |snapshot| Snapshot::store_snapshot(&context, &snapshot))
          .to_boxed(),
      ]
    } else if self.product() == &context.core.types.files_content {
      // If the requested product is FilesContent, request a Snapshot and lower it as FilesContent.
      let context = context.clone();
      vec![
        self
          .get_snapshot(&context)
          .and_then(move |snapshot|
            // Request the file contents of the Snapshot, and then store them.
            snapshot.contents(context.core.store.clone()).map_err(|e| throw(&e))
              .map(move |files_content| Snapshot::store_files_content(&context, &files_content)))
          .to_boxed(),
      ]
    } else if self.product() == &context.core.types.process_result {
      let context2 = context.clone();
      let execute_process_node = ExecuteProcess::lift(&self.subject);
      vec![
        context
          .get(execute_process_node)
          .map(move |result| {
            externs::unsafe_call(
              &context2.core.types.construct_process_result,
              &[
                externs::store_bytes(&result.0.stdout),
                externs::store_bytes(&result.0.stderr),
                externs::store_i32(result.0.exit_code),
              ],
            )
          })
          .to_boxed(),
      ]
    } else if let Some(&(_, ref value)) = context.core.tasks.gen_singleton(self.product()) {
      vec![future::ok(value.clone()).to_boxed()]
    } else {
      self
        .entries
        .iter()
        .map(|entry| {
          let task = context.core.rule_graph.task_for_inner(entry);
          context.get(Task {
            subject: self.subject.clone(),
            product: self.product().clone(),
            variants: self.variants.clone(),
            task: task,
            entry: Arc::new(entry.clone()),
          })
        })
        .collect::<Vec<NodeFuture<Value>>>()
    }
  }
///
/// Return Futures for each Task/Node that might be able to compute the given product for the
/// given subject and variants.
///
Return Futures for each Task/Node that might be able to compute the given product for the
given subject and variants.
Return Futures for each Task / Node that might be able to compute the given product for the given subject and variants .
fn gen_nodes(&self, context: &Context) -> Vec<NodeFuture<Value>> {
    // TODO: These `product==` hooks are hacky.
    if self.product() == &context.core.types.snapshot {
      // If the requested product is a Snapshot, execute a Snapshot Node and then lower to a Value
      // for this caller.
      let context = context.clone();
      vec![
        self
          .get_snapshot(&context)
          .map(move |snapshot| Snapshot::store_snapshot(&context, &snapshot))
          .to_boxed(),
      ]
    } else if self.product() == &context.core.types.files_content {
      // If the requested product is FilesContent, request a Snapshot and lower it as FilesContent.
      let context = context.clone();
      vec![
        self
          .get_snapshot(&context)
          .and_then(move |snapshot|
            // Request the file contents of the Snapshot, and then store them.
            snapshot.contents(context.core.store.clone()).map_err(|e| throw(&e))
              .map(move |files_content| Snapshot::store_files_content(&context, &files_content)))
          .to_boxed(),
      ]
    } else if self.product() == &context.core.types.process_result {
      let context2 = context.clone();
      let execute_process_node = ExecuteProcess::lift(&self.subject);
      vec![
        context
          .get(execute_process_node)
          .map(move |result| {
            externs::unsafe_call(
              &context2.core.types.construct_process_result,
              &[
                externs::store_bytes(&result.0.stdout),
                externs::store_bytes(&result.0.stderr),
                externs::store_i32(result.0.exit_code),
              ],
            )
          })
          .to_boxed(),
      ]
    } else if let Some(&(_, ref value)) = context.core.tasks.gen_singleton(self.product()) {
      vec![future::ok(value.clone()).to_boxed()]
    } else {
      self
        .entries
        .iter()
        .map(|entry| {
          let task = context.core.rule_graph.task_for_inner(entry);
          context.get(Task {
            subject: self.subject.clone(),
            product: self.product().clone(),
            variants: self.variants.clone(),
            task: task,
            entry: Arc::new(entry.clone()),
          })
        })
        .collect::<Vec<NodeFuture<Value>>>()
    }
  }
fn gen_nodes ( & self , context : & Context ) -> Vec < NodeFuture < Value > > { // TODO: These `product==` hooks are hacky. if self . product ( ) == & context . core . types . snapshot { // If the requested product is a Snapshot, execute a Snapshot Node and then lower to a Value // for this caller. let context = context . clone ( ) ; vec ! [ self get_snapshot ( context ) map ( move snapshot Snapshot store_snapshot ( context snapshot ) ) to_boxed ( ) ] } else if self . product ( ) == & context . core . types . files_content { // If the requested product is FilesContent, request a Snapshot and lower it as FilesContent. let context = context . clone ( ) ; vec ! [ self get_snapshot ( context ) and_then ( move snapshot // Request the file contents of the Snapshot, and then store them. snapshot contents ( context core store clone ( ) ) map_err ( e throw ( e ) ) map ( move files_content Snapshot store_files_content ( context files_content ) ) ) to_boxed ( ) ] } else if self . product ( ) == & context . core . types . process_result { let context2 = context . clone ( ) ; let execute_process_node = ExecuteProcess :: lift ( & self . subject ) ; vec ! [ context get ( execute_process_node ) map ( move result { externs unsafe_call ( context2 core types construct_process_result [ externs store_bytes ( result 0 stdout ) externs store_bytes ( result 0 stderr ) externs store_i32 ( result 0 exit_code ) ] ) } ) to_boxed ( ) ] } else if let Some ( & ( _ , ref value ) ) = context . core . tasks . gen_singleton ( self . product ( ) ) { vec ! [ future ok ( value clone ( ) ) to_boxed ( ) ] } else { self . entries . iter ( ) . map ( | entry | { let task = context . core . rule_graph . task_for_inner ( entry ) ; context . get ( Task { subject : self . subject . clone ( ) , product : self . product ( ) . clone ( ) , variants : self . variants . clone ( ) , task : task , entry : Arc :: new ( entry . clone ( ) ) , } ) } ) . collect :: < Vec < NodeFuture < Value > > > ( ) } }
Return Futures for each Task/Node that might be able to compute the given product for the
given subject and variants.
Return Futures for each Task / Node that might be able to compute the given product for the given subject and variants .
&self
context
&Context
&self
context
&Context