From f76b3008a69e376fac06a1c383936531748e654a Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Thu, 20 Aug 2020 19:11:27 +0200 Subject: rif: adding basic schema outline --- rif/src/lib.rs | 2 ++ rif/src/schema.rs | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 rif/src/schema.rs 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, + worksteps: BTreeSet, +} + +/// 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<()>; +} -- cgit v1.2.3