[][src]Struct bill::BillItem

pub struct BillItem<P> {
    pub amount: Amount,
    pub product: P,
}

Maps a BillProduct to an amount.

Fields

amount: Amountproduct: P

Methods

impl<P: BillProduct> BillItem<P>
[src]

pub fn gross(&self) -> Money
[src]

price * amount

pub fn tax(&self) -> Money
[src]

price * tax * amount, tax being less than 1.0

pub fn net(&self) -> Money
[src]

gross + tax

Trait Implementations

impl<P: Debug> Debug for BillItem<P>
[src]

Auto Trait Implementations

impl<P> Send for BillItem<P> where
    P: Send

impl<P> Sync for BillItem<P> where
    P: Sync

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

πŸ”¬ This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

πŸ”¬ This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]