aboutsummaryrefslogtreecommitdiffstats
path: root/src/node.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/node.rs')
-rw-r--r--src/node.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/node.rs b/src/node.rs
index 659d67f..3bcd73b 100644
--- a/src/node.rs
+++ b/src/node.rs
@@ -9,6 +9,9 @@ use crate::types::{Type, TypeSignature};
#[enum_dispatch]
pub trait ConcreteNode {
fn max_inputs(&self) -> usize;
+ fn num_inputs(&self, _connected: &[Option<Type>]) -> usize {
+ self.max_inputs()
+ }
// set of possible input type combinations given current connections
fn signatures_matching(&self, connected: &[Option<Type>]) -> Vec<TypeSignature>;
@@ -18,7 +21,7 @@ pub trait ConcreteNode {
fn compile(
&self,
signature: TypeSignature,
- inputs: Vec<String>,
+ inputs: Vec<Option<String>>,
outputs: Vec<String>,
f: &mut dyn fmt::Write,
) -> fmt::Result;