Trait mealdb::traits::MealDbBaseV1 [−][src]
pub trait MealDbBaseV1 { fn search_meal_by_name<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Meal>>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; fn get_meal<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Meal>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; fn get_random_meal<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Meal>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait; fn list_categories<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait; fn get_categories<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Category>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait; fn list_areas<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait; fn list_ingredients<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Ingredient>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait; fn filter_by_main_ingredient<'life0, 'life1, 'async_trait>(
&'life0 self,
ingredient: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; fn filter_by_category<'life0, 'life1, 'async_trait>(
&'life0 self,
category: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; fn filter_by_area<'life0, 'life1, 'async_trait>(
&'life0 self,
category: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; fn search_meal_by_first_letter<'life0, 'life1, 'async_trait>(
&'life0 self,
letter: &'life1 char
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Meal>>>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait, { ... } }
Expand description
MealDB features available to all users
Required methods
Searches for a meal by its specified name Returns a optional list of resulting meals
if let Some(matches) = api.search_meal_by_name("chicken").await?{ println!("Found some matches!"); }
Returns the specified meal by its ID, provided it exists.
Returns a random meal.
Returns the names of all categories.
Returns the details of all categories.
Returns the names of all areas.
fn list_ingredients<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Ingredient>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn list_ingredients<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Ingredient>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
returns the details of all ingredients
Returns the IDs of all meals containing the specified main ingredient, if any exist.
Returns the IDs of all meals in the specified category, if any exist.
Returns the IDs of all meals in the specified area, if any exist.
Provided methods
Finds all meals that start with the specified letter.
Same as search_meal_by_name
with a single-character string.