diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-02-15 22:25:39 +0100 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-02-15 22:25:39 +0100 |
| commit | b467f7202f5c0c3970e39ea396a0cec0fd6a36ee (patch) | |
| tree | aa567f84f0c2891d03de5b6414507c2d9a5f4754 /crates/rocie-client/src/models/recipe.rs | |
| parent | feat(treewide): Add recipes and user handling (diff) | |
| download | server-b467f7202f5c0c3970e39ea396a0cec0fd6a36ee.zip | |
chore(rocie-client): Re-generate the client api
Diffstat (limited to 'crates/rocie-client/src/models/recipe.rs')
| -rw-r--r-- | crates/rocie-client/src/models/recipe.rs | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/crates/rocie-client/src/models/recipe.rs b/crates/rocie-client/src/models/recipe.rs index e3b9d56..dfbbc03 100644 --- a/crates/rocie-client/src/models/recipe.rs +++ b/crates/rocie-client/src/models/recipe.rs @@ -11,18 +11,32 @@ use crate::models; use serde::{Deserialize, Serialize}; +/// Recipe : An recipe. These are transparently expressed in cooklang. #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Recipe { + /// The actual content of this recipe. #[serde(rename = "content")] - pub content: String, + pub content: models::CooklangRecipe, + /// The unique id of this recipe. #[serde(rename = "id")] pub id: models::RecipeId, - #[serde(rename = "path")] - pub path: String, + /// The name of the recipe. This should be globally unique, to make searching easier for the user. + #[serde(rename = "name")] + pub name: String, + /// The parent this recipe has. This is effectively it's anchor in the recipe DAG. None means, that it has no parents and as such is in the toplevel. + #[serde(rename = "parent", skip_serializing_if = "Option::is_none")] + pub parent: Option<models::RecipeParentId>, } impl Recipe { - pub fn new(content: String, id: models::RecipeId, path: String) -> Recipe { - Recipe { content, id, path } + /// An recipe. These are transparently expressed in cooklang. + pub fn new(content: models::CooklangRecipe, id: models::RecipeId, name: String) -> Recipe { + Recipe { + content, + id, + name, + parent: None, + } } } + |
