MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / main

Function main

ciphercore-base/src/bin/ciphercore_gen_zero_input.rs:30–47  ·  view source on GitHub ↗

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 >

()

Source from the content-addressed store, hash-verified

28///
29/// < this_binary > <inputs_path>
30fn 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}

Callers

nothing calls this directly

Calls 6

execute_mainFunction · 0.85
cloneMethod · 0.80
get_nodesMethod · 0.45
get_main_graphMethod · 0.45
get_operationMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected