#[derive(Debug)] pub struct Ingredient { pub key: &'static str, translates: IngredientTranslate, } #[derive(Debug)] pub struct IngredientTranslate { ru: &'static str, en: Option<&'static str>, } #[derive(Debug)] pub struct Recipe { key: &'static str, ingredients: Vec, 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, } #[derive(Debug)] pub struct RecipeTranslate { name: &'static str, instructions: Vec<&'static str>, } pub const INGREDIENTS: [Ingredient; 3] = [ 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"), } }, ];