aboutsummaryrefslogtreecommitdiff
path: root/src/actor.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-07 06:32:15 -0700
committerMelody Horn <melody@boringcactus.com>2021-03-07 06:32:15 -0700
commit28a8fb462fa88da300c6cf016ed3c70c402b8dba (patch)
treeb306bc95c4b38a4feba2bb36b5992a2a15c2411c /src/actor.rs
parent22acbd09f089aa3e6310791aee14debb139421e4 (diff)
downloadhope-28a8fb462fa88da300c6cf016ed3c70c402b8dba.tar.gz
hope-28a8fb462fa88da300c6cf016ed3c70c402b8dba.zip
add a good-enough-for-now system actor type
Diffstat (limited to 'src/actor.rs')
-rw-r--r--src/actor.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/actor.rs b/src/actor.rs
new file mode 100644
index 0000000..3b03fa6
--- /dev/null
+++ b/src/actor.rs
@@ -0,0 +1,29 @@
+use crate::number::Number;
+
+#[derive(Clone)]
+pub enum Type {
+ String,
+ Record {
+ name: String,
+ fields: Vec<Slot>
+ },
+ AnyNumber,
+ NumberInRange {
+ min: Option<Number>,
+ max: Option<Number>,
+ },
+ List {
+ contents: Box<Type>,
+ },
+}
+
+#[derive(Clone)]
+pub struct Slot {
+ pub name: String,
+ pub r#type: Type,
+}
+
+pub trait Actorful {
+ fn inputs() -> Vec<Slot>;
+ fn outputs() -> Vec<Slot>;
+}