Struct ezomyte::Price
[−]
[src]
pub struct Price(_, _);
Price of an item in a particular Currency
.
Methods
impl Price
[src]
pub fn new<A, C>(amount: A, currency: C) -> Self where
A: ToPrimitive,
C: Into<Quasi<Currency>>,
[src]
A: ToPrimitive,
C: Into<Quasi<Currency>>,
Create a new Price
object.
pub fn one<C>(currency: C) -> Self where
C: Into<Quasi<Currency>>,
[src]
C: Into<Quasi<Currency>>,
Create a new Price
of a single unit of given currency.
impl Price
[src]
pub fn amount(&self) -> f64
[src]
Price amount.
pub fn currency(&self) -> &Quasi<Currency>
[src]
Currency used in the price.
Trait Implementations
impl Clone for Price
[src]
fn clone(&self) -> Price
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Price
[src]
fn eq(&self, __arg_0: &Price) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Price) -> bool
[src]
This method tests for !=
.
impl PartialOrd for Price
[src]
fn partial_cmp(&self, other: &Price) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Debug for Price
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for Price
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'de> Deserialize<'de> for Price
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more