pub struct Recipe { /* private fields */ }
Expand description
Object that represents a Recipe of the Cocktail
data base.
§Description
This object is used to insert new data into the DB, or to retrieve data from the DB. Members that are wrapped
using an Option are allowed to take Null
values at creation time. The rest of the members must receive some
valid data when a new Recipe is built.
Implementations§
Source§impl Recipe
impl Recipe
Sourcepub fn new(
id: Option<Uuid>,
name: &str,
image_id: Option<&str>,
author_tags: Option<&[Tag]>,
tags: Option<&[Tag]>,
category: &str,
description: Option<&str>,
url: Option<&str>,
ingredients: &[RecipeContains],
steps: &[&str],
author_id: Option<&str>,
) -> Result<Self, DataDomainError>
pub fn new( id: Option<Uuid>, name: &str, image_id: Option<&str>, author_tags: Option<&[Tag]>, tags: Option<&[Tag]>, category: &str, description: Option<&str>, url: Option<&str>, ingredients: &[RecipeContains], steps: &[&str], author_id: Option<&str>, ) -> Result<Self, DataDomainError>
pub fn id(&self) -> Option<Uuid>
pub fn name(&self) -> &str
pub fn image_id(&self) -> Option<&str>
pub fn category(&self) -> RecipeCategory
pub fn rating(&self) -> StarRate
pub fn description(&self) -> Option<&str>
pub fn url(&self) -> Option<&str>
pub fn ingredients(&self) -> &[RecipeContains]
pub fn steps(&self) -> &[String]
pub fn creation_date(&self) -> Option<DateTime<Local>>
pub fn update_date(&self) -> Option<DateTime<Local>>
pub fn owner(&self) -> Option<Uuid>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Recipe
impl<'de> Deserialize<'de> for Recipe
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Recipe
impl RefUnwindSafe for Recipe
impl Send for Recipe
impl Sync for Recipe
impl Unpin for Recipe
impl UnwindSafe for 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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