pub struct ListExchangeRate { /* private fields */ }

Implementations

List of exchange rates implementation.

Create and return a new list exchange rate.

Return
  • See description.

Add a new exchange rate into the exchange rate list. The exchange rate is updated if it already exists.

Arguments
  • from_code - International currency code “from”.
  • to_code - International currency code “to”.
  • exchange_rate - The exchange rate in “from” (unit) / “to” (unit).
Return
  • True if successful, otherwise false.

Copy all exchange rates from the exchange rate list and return a new exchange rate list.

Return
  • See description.

Copy all exchange rates from the exchange rate list and return a new exchange rate list.

Return
  • See description.

Convert a value from one currency to another. Cross rates are used if the exchange rate is unavailable and the cross rate international currency code is not empty.

Arguments
  • value - The value to convert.
  • from_code - International currency code “from”.
  • to_code - International currency code “to”.
  • cross_rate_code - International currency code used for cross rates.
Return
  • See description.

Get the international currency code “from”.

Return
  • See description.

Get the international currency code “to”.

Return
  • See description.

Get the exchange rate in “from” (unit) / “to” (unit).

Return
  • See description.

Select a exchange rate based upon currency codes “from” and “to”.

Arguments
  • from_code - International currency code “from”.
  • to_code - International currency code “to”.
Return
  • True if successful, otherwise false.

Remove the selected exchange rate from the exchange rate list.

Return
  • True if successful, otherwise false.

Set the “from” international currency code.

Arguments
  • from_code_param - See description.
Return
  • True if successful, otherwise false.

Set the “to” international currency code.

Arguments
  • to_code - See description.
Return
  • True if successful, otherwise false.

Set the exchange rate.

Arguments
  • exchange_rate_param - See description.
Return
  • True if successful, otherwise false.

Determines when the exchange rate list is sorted.

Arguments
  • sort_on_add_param - If true sort when a exchange rate is added, otherwise do not sort (for bulk adds).
Return
  • True if successful, otherwise false.

Set sort updated.

Arguments
  • sort_updated_param - If true sort updated otherwise false.

Trait Implementations

List of exchange rates default implementation.

Create a new symbol element.

Return
  • See description.

List of exchange rates list implementation.

Clear all exchange rates from the exchange rate list.

Get the count of the exchange rate list.

Return
  • See description.

Get the index of the selected exchange rate (starting from 0).

Return
  • See description.

Select a exchange rate based upon an index value.

Arguments
  • index_param - The index value of the exchange rate to select (starting from 0).
Return
  • True if successful, otherwise false.

Set the list index.

Arguments
  • index_param - See description.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.