pub struct CartItem {
pub name: String,
pub price_cents: u32,
pub quantity: u32,
}Expand description
A line item in the shopping cart.
§Immutability
CartItem is immutable once created. Use the builder pattern for
complex item construction.
Fields§
§name: StringHuman-readable item name.
price_cents: u32Price per unit in cents.
quantity: u32Selected quantity.
Implementations§
Trait Implementations§
impl Eq for CartItem
impl StructuralPartialEq for CartItem
Auto Trait Implementations§
impl Freeze for CartItem
impl RefUnwindSafe for CartItem
impl Send for CartItem
impl Sync for CartItem
impl Unpin for CartItem
impl UnsafeUnpin for CartItem
impl UnwindSafe for CartItem
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.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
Compares
self with key and returns true if they are equal.