aboutsummaryrefslogtreecommitdiff
path: root/rif/src/schema.rs
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2020-08-20 19:11:27 +0200
committerKatharina Fey <kookie@spacekookie.de>2020-08-20 19:11:27 +0200
commitf76b3008a69e376fac06a1c383936531748e654a (patch)
treec9c6adfd58e5d6dde7743024ab473b01f8865678 /rif/src/schema.rs
parent32e75c5a00e3299198fda4601bc2f3551bf66106 (diff)
rif: adding basic schema outline
Diffstat (limited to 'rif/src/schema.rs')
-rw-r--r--rif/src/schema.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/rif/src/schema.rs b/rif/src/schema.rs
new file mode 100644
index 0000000..df7b6b4
--- /dev/null
+++ b/rif/src/schema.rs
@@ -0,0 +1,22 @@
+use identity::Identity as Id;
+
+/// A schema format backing a recipe set
+pub struct Schema {
+ ingredients: BTreeSet<Ingredient>,
+ worksteps: BTreeSet<Workstep>,
+}
+
+/// A string-tagged ingredient in a recipe
+pub trait Ingredient {
+ fn name(&self) -> String;
+ fn slug(&self) -> String;
+ fn id(&self) -> Id;
+}
+
+/// An execution step
+pub trait Workstep {
+ fn name(&self) -> String;
+ fn description(&self) -> String;
+ fn id(&self) -> Id;
+ async fn run(&self) -> Option<()>;
+}