Added MatrixCellChain::node()

This commit is contained in:
Weird Constructor 2022-07-24 07:46:37 +02:00
parent ff202ea891
commit 3bdb52f238

View file

@ -165,6 +165,14 @@ impl MatrixCellChain {
self.param_idx = self.chain.len() - 1;
}
/// Place a new node in the chain without any inputs or outputs. This is of limited
/// use in this API, but might makes a few corner cases easier in test cases.
pub fn node(&mut self, node_id: &str) -> &mut Self {
let cell = self.spawn_cell_from_node_id_name(node_id);
self.add_link(cell);
self
}
/// Place a new node in the chain with the given output assigned.
pub fn node_out(&mut self, node_id: &str, out: &str) -> &mut Self {
let mut cell = self.spawn_cell_from_node_id_name(node_id);