pub struct search_recipe;Expand description
GET method for the /recipe endpoint (Public).
§Description
The GET method allows searching a recipe in the DB. It expects multiple attributes to filter the recipes in the DB that shall be encoded in the url. The following keys can be used to perform a search:
name: Use a string that can match the name of a recipe (or part of it).tags: Only recipes that contain all the included tags in the query will be returned by the API.rating: Recipes that are scored with a rating greater or equal to the given rating will be returned by the API. See the schemaRecipeRatingfor more details.category: Filter recipes using one of the available categories. See the schemaRecipeCategoryfor more details.
A query can be composed by many attributes. For example, consider this query:
http://localhost:9090/recipe?name=margarita&tags=tequila&tags=reposado&rating=2Would return recipes that contain the string margarita in their name attribute; whose tags include tequila and reposado; and, whose rating is greater or equal to 4 stars.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for search_recipe
impl RefUnwindSafe for search_recipe
impl Send for search_recipe
impl Sync for search_recipe
impl Unpin for search_recipe
impl UnwindSafe for search_recipe
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more