MCPcopy Index your code
hub / github.com/ciphermodelabs/ciphercore / create_from_node

Method create_from_node

ciphercore-base/src/custom_ops.rs:459–474  ·  view source on GitHub ↗

`create_from_node` assumes that `node` carries a custom operation, and the ambient context is type checked.

(node: Node)

Source from the content-addressed store, hash-verified

457 /// `create_from_node` assumes that `node` carries a custom operation,
458 /// and the ambient context is type checked.
459 fn create_from_node(node: Node) -> Result<Self> {
460 if let Operation::Custom(custom_op) = node.get_operation() {
461 let mut node_dependencies_types = vec![];
462 for dependency in node.get_node_dependencies() {
463 node_dependencies_types.push(dependency.get_type()?);
464 }
465 Ok(Instantiation {
466 op: custom_op,
467 arguments_types: node_dependencies_types,
468 })
469 } else {
470 Err(runtime_error!(
471 "Instantiations can only be created from custom nodes"
472 ))
473 }
474 }
475
476 fn get_name(&self) -> String {
477 let mut name = "__".to_owned();

Callers

nothing calls this directly

Calls 4

get_node_dependenciesMethod · 0.80
get_operationMethod · 0.45
pushMethod · 0.45
get_typeMethod · 0.45

Tested by

no test coverage detected