This binary reads the context from a given file and prints JSON for zero inputs of appropriate types. # Arguments `inputs_path` - path to file that contains the context # Usage < this_binary >
()
| 28 | /// |
| 29 | /// < this_binary > <inputs_path> |
| 30 | fn main() { |
| 31 | env_logger::init(); |
| 32 | execute_main(|| -> Result<()> { |
| 33 | let args = Args::parse(); |
| 34 | let context = serde_json::from_str::<Context>(&fs::read_to_string(args.input_context)?)?; |
| 35 | let mut inputs = vec![]; |
| 36 | for node in context.get_main_graph()?.get_nodes() { |
| 37 | if let Operation::Input(ref input_type) = node.get_operation() { |
| 38 | inputs.push(TypedValue::new( |
| 39 | input_type.clone(), |
| 40 | Value::zero_of_type(input_type.clone()), |
| 41 | )?); |
| 42 | } |
| 43 | } |
| 44 | println!("{}", serde_json::to_string(&inputs)?); |
| 45 | Ok(()) |
| 46 | }); |
| 47 | } |
nothing calls this directly
no test coverage detected