Struct tulipv2_sdk_common::lending::reserve::CollateralExchangeRate
source · [−]pub struct CollateralExchangeRate(_);Expand description
Collateral exchange rate
Implementations
sourceimpl CollateralExchangeRate
impl CollateralExchangeRate
sourcepub fn collateral_to_liquidity(
&self,
collateral_amount: u64
) -> Result<u64, ProgramError>
pub fn collateral_to_liquidity(
&self,
collateral_amount: u64
) -> Result<u64, ProgramError>
Convert reserve collateral to liquidity
sourcepub fn decimal_collateral_to_liquidity(
&self,
collateral_amount: Decimal
) -> Result<Decimal, ProgramError>
pub fn decimal_collateral_to_liquidity(
&self,
collateral_amount: Decimal
) -> Result<Decimal, ProgramError>
Convert reserve collateral to liquidity
sourcepub fn liquidity_to_collateral(
&self,
liquidity_amount: u64
) -> Result<u64, ProgramError>
pub fn liquidity_to_collateral(
&self,
liquidity_amount: u64
) -> Result<u64, ProgramError>
Convert reserve liquidity to collateral
sourcepub fn decimal_liquidity_to_collateral(
&self,
liquidity_amount: Decimal
) -> Result<Decimal, ProgramError>
pub fn decimal_liquidity_to_collateral(
&self,
liquidity_amount: Decimal
) -> Result<Decimal, ProgramError>
Convert reserve liquidity to collateral
Trait Implementations
sourceimpl Clone for CollateralExchangeRate
impl Clone for CollateralExchangeRate
sourcefn clone(&self) -> CollateralExchangeRate
fn clone(&self) -> CollateralExchangeRate
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 CollateralExchangeRate
impl Debug for CollateralExchangeRate
sourceimpl From<CollateralExchangeRate> for Rate
impl From<CollateralExchangeRate> for Rate
sourcefn from(exchange_rate: CollateralExchangeRate) -> Self
fn from(exchange_rate: CollateralExchangeRate) -> Self
Converts to this type from the input type.
impl Copy for CollateralExchangeRate
Auto Trait Implementations
impl RefUnwindSafe for CollateralExchangeRate
impl Send for CollateralExchangeRate
impl Sync for CollateralExchangeRate
impl Unpin for CollateralExchangeRate
impl UnwindSafe for CollateralExchangeRate
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
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