pub struct Product {
pub id: ProductId,
pub name: String,
pub slug: String,
pub description: String,
pub status: ProductStatus,
pub product_type: ProductType,
pub attributes: Vec<ProductAttribute>,
pub seo: Option<SeoMetadata>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Product entity
Fields§
§id: ProductId§name: String§slug: String§description: String§status: ProductStatus§product_type: ProductType§attributes: Vec<ProductAttribute>§seo: Option<SeoMetadata>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl Product
impl Product
Sourcepub fn generate_slug(name: &str) -> String
pub fn generate_slug(name: &str) -> String
Generate slug from name if not provided
Sourcepub fn is_purchasable(&self) -> bool
pub fn is_purchasable(&self) -> bool
Check if product is purchasable
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Product
impl<'de> Deserialize<'de> for Product
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Product, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Product, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Product
Source§impl Serialize for Product
impl Serialize for Product
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Product
Auto Trait Implementations§
impl Freeze for Product
impl RefUnwindSafe for Product
impl Send for Product
impl Sync for Product
impl Unpin for Product
impl UnsafeUnpin for Product
impl UnwindSafe for Product
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