1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
use crate::{nutrition_information::NutritionInformation, restricted_diet::RestrictedDiet};
use std::time::Duration;
/// Provides methods to retrieve information from a recipe after it has been scraped.
/// See <https://schema.org/Recipe>
pub trait RecipeInformationProvider {
/// The author of the recipe.
fn authors(&self) -> Option<Vec<String>>;
/// The categories of the recipe, e.g. appetizer, entrée, etc.
fn categories(&self) -> Option<Vec<String>>;
/// The time it takes to actually cook the dish.
fn cook_time(&self) -> Option<Duration>;
/// The cuisines of the recipe, e.g. mexican-inspired, french, etc.
fn cuisines(&self) -> Option<Vec<String>>;
/// The description of the recipe.
fn description(&self) -> Option<String>;
/// A URL to an image of the dish.
fn image_url(&self) -> Option<String>;
/// All the ingredients used in the recipe.
fn ingredients(&self) -> Option<Vec<String>>;
/// All the steps in making the recipe.
fn instructions(&self) -> Option<Vec<String>>;
/// The language used in the recipe expressed in IETF BCP 47 standard.
fn language(&self) -> Option<String>;
/// The name of the recipe.
fn name(&self) -> Option<String>;
/// Nutritional information about the dish.
fn nutrition(&self) -> Option<NutritionInformation>;
/// The length of time it takes to prepare the items to be used in the instructions.
fn prep_time(&self) -> Option<Duration>;
/// Indicates dietary restrictions or guidelines for which the recipe is suitable.
fn suitable_diets(&self) -> Option<Vec<RestrictedDiet>>;
/// The total time required to perform the instructions (including the prep time).
fn total_time(&self) -> Option<Duration>;
/// The quantity that results from the recipe.
fn yields(&self) -> Option<String>;
}