Construct a new [`ProtoNode`] with the specified construction args and a `ClonedNode` implementation.
(value: ConstructionArgs, path: Vec<NodeId>)
| 170 | |
| 171 | /// Construct a new [`ProtoNode`] with the specified construction args and a `ClonedNode` implementation. |
| 172 | pub fn value(value: ConstructionArgs, path: Vec<NodeId>) -> Self { |
| 173 | let inputs_exposed = match &value { |
| 174 | ConstructionArgs::Nodes(nodes) => nodes.len() + 1, |
| 175 | _ => 2, |
| 176 | }; |
| 177 | Self { |
| 178 | identifier: ProtoNodeIdentifier::new("core_types::value::ClonedNode"), |
| 179 | construction_args: value, |
| 180 | call_argument: concrete!(Context), |
| 181 | original_location: OriginalLocation { |
| 182 | path: Some(path), |
| 183 | inputs_exposed: vec![false; inputs_exposed], |
| 184 | ..Default::default() |
| 185 | }, |
| 186 | skip_deduplication: false, |
| 187 | context_features: Default::default(), |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | /// Converts all references to other node IDs into new IDs by running the specified function on them. |
| 192 | /// This can be used when changing the IDs of the nodes, for example in the case of generating stable IDs. |
no test coverage detected