aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rif/src/lib.rs2
-rw-r--r--rif/src/schema.rs22
2 files changed, 24 insertions, 0 deletions
diff --git a/rif/src/lib.rs b/rif/src/lib.rs
index af6f75d..0e18044 100644
--- a/rif/src/lib.rs
+++ b/rif/src/lib.rs
@@ -20,3 +20,5 @@
//!
//! ```
+
+mod schema;
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<()>;
+}