diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-08-23 14:46:27 +0200 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-08-23 14:46:27 +0200 |
commit | 4d389ad4e6223ba56ec739fca55ad2e170a06a2b (patch) | |
tree | c4c2a90cb3a52cd7822706ddeb1d2be8620c44db /rif/src/recipe.rs | |
parent | 9f00deb9fcb35f43c2511a0ea562eed33271c723 (diff) |
Diffstat (limited to 'rif/src/recipe.rs')
-rw-r--r-- | rif/src/recipe.rs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/rif/src/recipe.rs b/rif/src/recipe.rs index 21b7912..0e3b8fe 100644 --- a/rif/src/recipe.rs +++ b/rif/src/recipe.rs @@ -2,16 +2,23 @@ use crate::{Ingredient, Schema, Thread, Workstep}; use std::collections::BTreeSet; /// A recipe with instructions to execute -pub struct Recipe<I, W> -where - I: Ingredient, - W: Workstep, -{ - schema: Schema<I, W>, +pub struct Recipe { + schema: Schema, metadata: Metadata, threads: BTreeSet<Thread>, } +impl Recipe { + /// Create a new recipe from a schema, with a name and version + pub fn new(schema: Schema, name: String, version: String) -> Self { + Self { + schema, + metadata: Metadata { name, version }, + threads: Default::default(), + } + } +} + pub struct Metadata { pub name: String, pub version: String, |