`create_from_node` assumes that `node` carries a custom operation, and the ambient context is type checked.
(node: Node)
| 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(); |
nothing calls this directly
no test coverage detected