diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-08-20 19:11:27 +0200 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-08-20 19:11:27 +0200 |
commit | f76b3008a69e376fac06a1c383936531748e654a (patch) | |
tree | c9c6adfd58e5d6dde7743024ab473b01f8865678 | |
parent | 32e75c5a00e3299198fda4601bc2f3551bf66106 (diff) |
rif: adding basic schema outline
-rw-r--r-- | rif/src/lib.rs | 2 | ||||
-rw-r--r-- | rif/src/schema.rs | 22 |
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<()>; +} |