Struct concordium_std::ExchangeRates
source · pub struct ExchangeRates {
pub euro_per_energy: ExchangeRate,
pub micro_ccd_per_euro: ExchangeRate,
}
Expand description
The euro/NRG and microCCD/euro exchange rates.
Fields§
§euro_per_energy: ExchangeRate
Euro per NRG exchange rate.
micro_ccd_per_euro: ExchangeRate
Micro CCD per Euro exchange rate.
Implementations§
source§impl 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§
source§impl Clone for ExchangeRates
impl Clone for ExchangeRates
source§fn clone(&self) -> ExchangeRates
fn clone(&self) -> ExchangeRates
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ExchangeRates
impl Debug for ExchangeRates
source§impl Deserial for ExchangeRates
impl Deserial for ExchangeRates
source§fn deserial<R>(source: &mut R) -> Result<ExchangeRates, ParseError>where
R: Read,
fn deserial<R>(source: &mut R) -> Result<ExchangeRates, ParseError>where
R: Read,
Attempt to read a structure from a given source, failing if an error
occurs during deserialization or reading.
source§impl PartialEq for ExchangeRates
impl PartialEq for ExchangeRates
source§fn eq(&self, other: &ExchangeRates) -> bool
fn eq(&self, other: &ExchangeRates) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serial for ExchangeRates
impl Serial for ExchangeRates
impl Copy for ExchangeRates
impl Eq for ExchangeRates
impl StructuralPartialEq for ExchangeRates
Auto Trait Implementations§
impl Freeze for ExchangeRates
impl RefUnwindSafe for ExchangeRates
impl Send for ExchangeRates
impl Sync for ExchangeRates
impl Unpin for ExchangeRates
impl UnwindSafe for ExchangeRates
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<D, S> DeserialWithState<S> for Dwhere
D: Deserial,
S: HasStateApi,
impl<D, S> DeserialWithState<S> for Dwhere
D: Deserial,
S: HasStateApi,
source§fn deserial_with_state<R>(_state: &S, source: &mut R) -> Result<D, ParseError>where
R: Read,
fn deserial_with_state<R>(_state: &S, source: &mut R) -> Result<D, ParseError>where
R: Read,
Attempt to read a structure from a given source and state, failing if
an error occurs during deserialization or reading.