pub struct post_recipe;
Expand description
POST method for the /recipe endpoint (Restricted)
§Description
This method creates new recipes in the DB using the data provided by authors. Recipes are identified by an unique ID that is generated by the backend sw before inserting a recipe into the DB. This means that the same recipe can be pushed several times either by the same author or by another one.
A previous search in the DB is advised to avoid having many similar recipes. However, every author is free to add a recipe that is quite similar to another one if he/she likes to.
A new recipe shall populate all the fields marked with a red asterisk in the recipe’s schema. Fields that are optional (not marked with the red asterisk) are, most likely, being filled by the backend logic. However, the following optional fields are meant to be populated by the author, but they are not mandatory:
- author_tags: Tags that can be freely assigned by the author.
- description: A free text input in which the author can describe in detail the recipe.
- url: Useful to link the recipe entry to another web resource.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for post_recipe
impl RefUnwindSafe for post_recipe
impl Send for post_recipe
impl Sync for post_recipe
impl Unpin for post_recipe
impl UnwindSafe for post_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
§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>
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>
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