pub struct Product<T, U>{
pub quantity: T,
pub weight: U,
pub dimensions: Dimensions<U>,
pub description: String,
pub id: Option<u32>,
}Fields§
§quantity: T§weight: U§dimensions: Dimensions<U>§description: String§id: Option<u32>Implementations§
Source§impl<T, U> Product<T, U>
impl<T, U> Product<T, U>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new empty Product instance
This is a convenience function to create a valid Product fast
§Examples
For example, there is an opaque function that modifies the product
// use transdirect::prelude::Product;
//
// fn deliver_extra(prod: &mut Product) -> Result<(), String> {
//
// }
// let m = Product::new();
Trait Implementations§
Source§impl<'de, T, U> Deserialize<'de> for Product<T, U>
impl<'de, T, U> Deserialize<'de> for Product<T, U>
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
impl<T, U> Eq for Product<T, U>
impl<T, U> StructuralPartialEq for Product<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for Product<T, U>
impl<T, U> RefUnwindSafe for Product<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for Product<T, U>
impl<T, U> Sync for Product<T, U>
impl<T, U> Unpin for Product<T, U>
impl<T, U> UnwindSafe for Product<T, U>where
T: UnwindSafe,
U: UnwindSafe,
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.