137 lines
2.7 KiB
Rust
137 lines
2.7 KiB
Rust
|
||
#[derive(Debug)]
|
||
pub struct Ingredient {
|
||
pub key: &'static str,
|
||
pub translates: IngredientTranslate,
|
||
}
|
||
|
||
#[derive(Debug)]
|
||
pub struct IngredientTranslate {
|
||
pub ru: &'static str,
|
||
pub en: Option<&'static str>,
|
||
}
|
||
|
||
#[derive(Debug)]
|
||
pub struct Recipe {
|
||
key: &'static str,
|
||
ingredients: Vec<RecipeIngredient>,
|
||
steps: u8,
|
||
translates: RecipeTranslates,
|
||
}
|
||
|
||
#[derive(Debug)]
|
||
pub struct RecipeIngredient {
|
||
key: &'static str,
|
||
measure: RecipeIngredientMeasure,
|
||
}
|
||
|
||
#[derive(Debug)]
|
||
pub enum RecipeIngredientMeasure {
|
||
Gram(u32),
|
||
KiloGram(u32),
|
||
MilliLiter(u32),
|
||
Liter(u32),
|
||
}
|
||
|
||
#[derive(Debug)]
|
||
pub struct RecipeTranslates {
|
||
ru: RecipeTranslate,
|
||
en: Option<RecipeTranslate>,
|
||
}
|
||
|
||
#[derive(Debug)]
|
||
pub struct RecipeTranslate {
|
||
name: &'static str,
|
||
instructions: Vec<&'static str>,
|
||
}
|
||
|
||
pub const INGREDIENTS: [Ingredient; 11] = [
|
||
Ingredient {
|
||
key: "water",
|
||
translates: IngredientTranslate {
|
||
ru: "вода",
|
||
en: Some("water"),
|
||
},
|
||
},
|
||
|
||
Ingredient {
|
||
key: "carrot",
|
||
translates: IngredientTranslate {
|
||
ru: "морковь",
|
||
en: Some("carrot"),
|
||
},
|
||
},
|
||
|
||
Ingredient {
|
||
key: "potato",
|
||
translates: IngredientTranslate {
|
||
ru: "картофель",
|
||
en: Some("potato"),
|
||
},
|
||
},
|
||
|
||
Ingredient {
|
||
key: "wheat_flour",
|
||
translates: IngredientTranslate {
|
||
ru: "пшеничная мука",
|
||
en: Some("wheat flour"),
|
||
},
|
||
},
|
||
|
||
Ingredient {
|
||
key: "olive_oil",
|
||
translates: IngredientTranslate {
|
||
ru: "оливковое масло",
|
||
en: Some("olive oil"),
|
||
},
|
||
},
|
||
|
||
Ingredient {
|
||
key: "dry_yeast",
|
||
translates: IngredientTranslate {
|
||
ru: "сухие дрожжи",
|
||
en: Some("dry yeast"),
|
||
},
|
||
},
|
||
|
||
Ingredient {
|
||
key: "apple",
|
||
translates: IngredientTranslate {
|
||
ru: "яблоко",
|
||
en: Some("apple"),
|
||
},
|
||
},
|
||
|
||
Ingredient {
|
||
key: "banana",
|
||
translates: IngredientTranslate {
|
||
ru: "банан",
|
||
en: Some("banana"),
|
||
},
|
||
},
|
||
|
||
Ingredient {
|
||
key: "orange",
|
||
translates: IngredientTranslate {
|
||
ru: "апельсин",
|
||
en: Some("orange"),
|
||
},
|
||
},
|
||
|
||
Ingredient {
|
||
key: "salt",
|
||
translates: IngredientTranslate {
|
||
ru: "соль",
|
||
en: Some("salt"),
|
||
},
|
||
},
|
||
|
||
Ingredient {
|
||
key: "sugar",
|
||
translates: IngredientTranslate {
|
||
ru: "сахар",
|
||
en: Some("sugar"),
|
||
},
|
||
},
|
||
];
|