From 3bdb52f2384bb7e0925888b5516282006cfe7950 Mon Sep 17 00:00:00 2001 From: Weird Constructor Date: Sun, 24 Jul 2022 07:46:37 +0200 Subject: [PATCH] Added MatrixCellChain::node() --- src/chain_builder.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/chain_builder.rs b/src/chain_builder.rs index f1c10c5..dbfb08b 100644 --- a/src/chain_builder.rs +++ b/src/chain_builder.rs @@ -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);