recipes/db/src/types.rs

46 lines
856 B
Rust

#[derive(Debug)]
pub struct Ingredient {
pub key: &'static str,
pub translates: IngredientTranslate,
}
#[derive(Debug)]
pub struct IngredientTranslate {
pub rus: &'static str,
pub eng: Option<&'static str>,
}
#[derive(Debug)]
pub struct Recipe {
pub key: &'static str,
pub steps: u8,
pub ingredients: Vec<RecipeIngredient>,
pub translates: RecipeTranslates,
}
#[derive(Debug)]
pub struct RecipeIngredient {
pub key: &'static str,
pub measure: Measure,
}
#[derive(Debug, Clone, Copy)]
pub enum Measure {
Gram(u32),
KiloGram(u32),
MilliLiter(u32),
Liter(u32),
}
#[derive(Debug)]
pub struct RecipeTranslates {
pub rus: RecipeTranslate,
pub eng: Option<RecipeTranslate>,
}
#[derive(Debug)]
pub struct RecipeTranslate {
pub name: &'static str,
pub instructions: Vec<&'static str>,
}