pub struct TransferExchangeRate {
pub rate: String,
pub source_asset: Asset,
pub target_asset: Asset,
}Expand description
Exchange rate information for currency conversion. The rate indicates how much of the target asset is equivalent to one unit of the source asset.
JSON schema
{
"description": "Exchange rate information for currency conversion. The rate indicates how much of the target asset is equivalent to one unit of the source asset.",
"examples": [
{
"rate": "1",
"sourceAsset": "usd",
"targetAsset": "usdc"
}
],
"type": "object",
"required": [
"rate",
"sourceAsset",
"targetAsset"
],
"properties": {
"rate": {
"description": "The exchange rate value as a decimal string. Indicates how many units of the target asset equal one unit of the source asset.",
"examples": [
"1"
],
"type": "string"
},
"sourceAsset": {
"description": "The asset being converted from.",
"examples": [
"usd"
],
"allOf": [
{
"$ref": "#/components/schemas/Asset"
}
]
},
"targetAsset": {
"description": "The asset being converted to.",
"examples": [
"usdc"
],
"allOf": [
{
"$ref": "#/components/schemas/Asset"
}
]
}
}
}Fields§
§rate: StringThe exchange rate value as a decimal string. Indicates how many units of the target asset equal one unit of the source asset.
source_asset: AssetThe asset being converted from.
target_asset: AssetThe asset being converted to.
Implementations§
Source§impl TransferExchangeRate
impl TransferExchangeRate
pub fn builder() -> TransferExchangeRate
Trait Implementations§
Source§impl Clone for TransferExchangeRate
impl Clone for TransferExchangeRate
Source§fn clone(&self) -> TransferExchangeRate
fn clone(&self) -> TransferExchangeRate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TransferExchangeRate
impl Debug for TransferExchangeRate
Source§impl<'de> Deserialize<'de> for TransferExchangeRate
impl<'de> Deserialize<'de> for TransferExchangeRate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&TransferExchangeRate> for TransferExchangeRate
impl From<&TransferExchangeRate> for TransferExchangeRate
Source§fn from(value: &TransferExchangeRate) -> Self
fn from(value: &TransferExchangeRate) -> Self
Converts to this type from the input type.
Source§impl From<TransferExchangeRate> for TransferExchangeRate
impl From<TransferExchangeRate> for TransferExchangeRate
Source§fn from(value: TransferExchangeRate) -> Self
fn from(value: TransferExchangeRate) -> Self
Converts to this type from the input type.
Source§impl Serialize for TransferExchangeRate
impl Serialize for TransferExchangeRate
Source§impl TryFrom<TransferExchangeRate> for TransferExchangeRate
impl TryFrom<TransferExchangeRate> for TransferExchangeRate
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: TransferExchangeRate) -> Result<Self, ConversionError>
fn try_from(value: TransferExchangeRate) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for TransferExchangeRate
impl RefUnwindSafe for TransferExchangeRate
impl Send for TransferExchangeRate
impl Sync for TransferExchangeRate
impl Unpin for TransferExchangeRate
impl UnsafeUnpin for TransferExchangeRate
impl UnwindSafe for TransferExchangeRate
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