aboutsummaryrefslogtreecommitdiff
path: root/rif/src/recipe.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rif/src/recipe.rs')
-rw-r--r--rif/src/recipe.rs19
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,