[][src]Struct rusty_money::ExchangeRate

pub struct ExchangeRate<'a, T: FormattableCurrency> {
    pub from: &'a T,
    pub to: &'a T,
    // some fields omitted
}

Stores rates of conversion between two currencies.

Fields

from: &'a Tto: &'a T

Implementations

impl<'a, T: FormattableCurrency> ExchangeRate<'a, T>[src]

pub fn new(
    from: &'a T,
    to: &'a T,
    rate: Decimal
) -> Result<ExchangeRate<'a, T>, MoneyError>
[src]

pub fn convert(&self, amount: Money<'a, T>) -> Result<Money<'a, T>, MoneyError>[src]

Converts a Money from one Currency to another using the exchange rate.

Trait Implementations

impl<'a, T: Clone + FormattableCurrency> Clone for ExchangeRate<'a, T>[src]

impl<'a, T: Copy + FormattableCurrency> Copy for ExchangeRate<'a, T>[src]

impl<'a, T: Debug + FormattableCurrency> Debug for ExchangeRate<'a, T>[src]

impl<'a, T: PartialEq + FormattableCurrency> PartialEq<ExchangeRate<'a, T>> for ExchangeRate<'a, T>[src]

impl<'a, T: FormattableCurrency> StructuralPartialEq for ExchangeRate<'a, T>[src]

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for ExchangeRate<'a, T> where
    T: RefUnwindSafe
[src]

impl<'a, T> Send for ExchangeRate<'a, T> where
    T: Sync
[src]

impl<'a, T> Sync for ExchangeRate<'a, T> where
    T: Sync
[src]

impl<'a, T> Unpin for ExchangeRate<'a, T>[src]

impl<'a, T> UnwindSafe for ExchangeRate<'a, T> where
    T: RefUnwindSafe
[src]

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.