Struct concordium_std::ExchangeRates
source · pub struct ExchangeRates {
pub euro_per_energy: ExchangeRate,
pub micro_ccd_per_euro: ExchangeRate,
}
Expand description
The current exchange rates.
Fields
euro_per_energy: ExchangeRate
Euro per NRG exchange rate.
micro_ccd_per_euro: ExchangeRate
Micro CCD per Euro exchange rate.
Implementations
sourceimpl ExchangeRates
impl ExchangeRates
sourcepub fn convert_euro_cent_to_amount(&self, euro_cent: u64) -> Amount
pub fn convert_euro_cent_to_amount(&self, euro_cent: u64) -> Amount
Convert Euro cent to CCD using the current exchange rate. This will round down to the nearest micro CCD.
sourcepub fn convert_amount_to_euro_cent(&self, amount: Amount) -> u64
pub fn convert_amount_to_euro_cent(&self, amount: Amount) -> u64
Convert CCD to Euro cent using the current exchange rate. This will round down to the nearest Euro cent.
Trait Implementations
sourceimpl Clone for ExchangeRates
impl Clone for ExchangeRates
sourcefn clone(&self) -> ExchangeRates
fn clone(&self) -> ExchangeRates
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ExchangeRates
impl Debug for ExchangeRates
sourceimpl Deserial for ExchangeRates
impl Deserial for ExchangeRates
sourceimpl Serial for ExchangeRates
impl Serial for ExchangeRates
impl Copy for ExchangeRates
Auto Trait Implementations
impl RefUnwindSafe for ExchangeRates
impl Send for ExchangeRates
impl Sync for ExchangeRates
impl Unpin for ExchangeRates
impl UnwindSafe for ExchangeRates
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more