[][src]Struct monet::Exponent

pub struct Exponent {
    pub amount: CurrencyAmount,
    pub exponent: u8,
}

Tuple struct used to define an amount with an exponent. Useful when used in Mul/Div operations:

use monet::Exponent;

assert_eq!(Exponent::new(1_000.into(), 2), Exponent::new(10.into(), 0));

Fields

amount: CurrencyAmountexponent: u8

Methods

impl Exponent[src]

pub fn new(amount: CurrencyAmount, exponent: u8) -> Self[src]

Trait Implementations

impl Clone for Exponent[src]

impl Copy for Exponent[src]

impl PartialEq<Exponent> for Exponent[src]

fn eq(&self, other: &Exponent) -> bool[src]

Compares two Exponents.

Warning!

Two might result equal due to precision losses.

impl Debug for Exponent[src]

impl Div<Exponent> for Money[src]

type Output = Div<Self>

The resulting type after applying the / operator.

impl Mul<Exponent> for Money[src]

type Output = Mul<Self>

The resulting type after applying the * operator.

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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