fn lift(value: &Value) -> Result<ExecuteProcess, String> {
    let mut env: BTreeMap<String, String> = BTreeMap::new();
    let env_var_parts = externs::project_multi_strs(&value, "env");
    if env_var_parts.len() % 2 != 0 {
      return Err("Error parsing env: odd number of parts".to_owned());
    }
    for i in 0..(env_var_parts.len() / 2) {
      env.insert(
        env_var_parts[2 * i].clone(),
        env_var_parts[2 * i + 1].clone(),
      );
    }
    let digest = lift_digest(&externs::project_ignoring_type(&value, "input_files"))
      .map_err(|err| format!("Error parsing digest {}", err))?;

    let output_files = externs::project_multi_strs(&value, "output_files")
      .into_iter()
      .map(PathBuf::from)
      .collect();

    let output_directories = externs::project_multi_strs(&value, "output_directories")
      .into_iter()
      .map(PathBuf::from)
      .collect();

    let timeout_str = externs::project_str(&value, "timeout_seconds");
    let timeout_in_seconds = timeout_str
      .parse::<f64>()
      .map_err(|err| format!("Timeout was not a float: {:?}", err))?;

    if timeout_in_seconds < 0.0 {
      return Err(format!("Timeout was negative: {:?}", timeout_in_seconds));
    }

    let description = externs::project_str(&value, "description");

    let jdk_home = {
      let val = externs::project_str(&value, "jdk_home");
      if val.is_empty() {
        None
      } else {
        Some(PathBuf::from(val))
      }
    };

    Ok(ExecuteProcess(process_execution::ExecuteProcessRequest {
      argv: externs::project_multi_strs(&value, "argv"),
      env: env,
      input_files: digest,
      output_files: output_files,
      output_directories: output_directories,
      timeout: Duration::from_millis((timeout_in_seconds * 1000.0) as u64),
      description: description,
      jdk_home: jdk_home,
    }))
  }
///
/// Lifts a Key representing a python ExecuteProcessRequest value into a ExecuteProcess Node.
///
Lifts a Key representing a python ExecuteProcessRequest value into a ExecuteProcess Node.
Lifts a Key representing a python ExecuteProcessRequest value into a ExecuteProcess Node .
fn lift(value: &Value) -> Result<ExecuteProcess, String> {
    let mut env: BTreeMap<String, String> = BTreeMap::new();
    let env_var_parts = externs::project_multi_strs(&value, "env");
    if env_var_parts.len() % 2 != 0 {
      return Err("Error parsing env: odd number of parts".to_owned());
    }
    for i in 0..(env_var_parts.len() / 2) {
      env.insert(
        env_var_parts[2 * i].clone(),
        env_var_parts[2 * i + 1].clone(),
      );
    }
    let digest = lift_digest(&externs::project_ignoring_type(&value, "input_files"))
      .map_err(|err| format!("Error parsing digest {}", err))?;
    let output_files = externs::project_multi_strs(&value, "output_files")
      .into_iter()
      .map(PathBuf::from)
      .collect();
    let output_directories = externs::project_multi_strs(&value, "output_directories")
      .into_iter()
      .map(PathBuf::from)
      .collect();
    let timeout_str = externs::project_str(&value, "timeout_seconds");
    let timeout_in_seconds = timeout_str
      .parse::<f64>()
      .map_err(|err| format!("Timeout was not a float: {:?}", err))?;
    if timeout_in_seconds < 0.0 {
      return Err(format!("Timeout was negative: {:?}", timeout_in_seconds));
    }
    let description = externs::project_str(&value, "description");
    let jdk_home = {
      let val = externs::project_str(&value, "jdk_home");
      if val.is_empty() {
        None
      } else {
        Some(PathBuf::from(val))
      }
    };
    Ok(ExecuteProcess(process_execution::ExecuteProcessRequest {
      argv: externs::project_multi_strs(&value, "argv"),
      env: env,
      input_files: digest,
      output_files: output_files,
      output_directories: output_directories,
      timeout: Duration::from_millis((timeout_in_seconds * 1000.0) as u64),
      description: description,
      jdk_home: jdk_home,
    }))
  }
fn lift ( value : & Value ) -> Result < ExecuteProcess , String > { let mut env : BTreeMap < String , String > = BTreeMap :: new ( ) ; let env_var_parts = externs :: project_multi_strs ( & value , " " ) ; if env_var_parts . len ( ) % 2 != 0 { return Err ( " " . to_owned ( ) ) ; } for i in 0 .. ( env_var_parts . len ( ) / 2 ) { env . insert ( env_var_parts [ 2 * i ] . clone ( ) , env_var_parts [ 2 * i + 1 ] . clone ( ) , ) ; } let digest = lift_digest ( & externs :: project_ignoring_type ( & value , " " ) ) . map_err ( | err | format ! ( " " err ) ) ? ; let output_files = externs :: project_multi_strs ( & value , " " ) . into_iter ( ) . map ( PathBuf :: from ) . collect ( ) ; let output_directories = externs :: project_multi_strs ( & value , " " ) . into_iter ( ) . map ( PathBuf :: from ) . collect ( ) ; let timeout_str = externs :: project_str ( & value , " " ) ; let timeout_in_seconds = timeout_str . parse :: < f64 > ( ) . map_err ( | err | format ! ( " " err ) ) ? ; if timeout_in_seconds < 0.0 { return Err ( format ! ( " " timeout_in_seconds ) ) ; } let description = externs :: project_str ( & value , " " ) ; let jdk_home = { let val = externs :: project_str ( & value , " " ) ; if val . is_empty ( ) { None } else { Some ( PathBuf :: from ( val ) ) } } ; Ok ( ExecuteProcess ( process_execution :: ExecuteProcessRequest { argv : externs :: project_multi_strs ( & value , " " ) , env : env , input_files : digest , output_files : output_files , output_directories : output_directories , timeout : Duration :: from_millis ( ( timeout_in_seconds * 1000.0 ) as u64 ) , description : description , jdk_home : jdk_home , } ) ) }
Lifts a Key representing a python ExecuteProcessRequest value into a ExecuteProcess Node.
Lifts a Key representing a python ExecuteProcessRequest value into a ExecuteProcess Node .
value
&Value
value
&Value