aboutsummaryrefslogtreecommitdiff
path: root/rif/src/schema.rs
diff options
context:
space:
mode:
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<()>;
+}