Struct stellar_client::resources::Asset [−][src]
pub struct Asset { /* fields omitted */ }Assets are the units that are traded on the Stellar Network. An asset consists of an type, code, and issuer. Any asset can be traded for any other asset.
https://www.stellar.org/developers/horizon/reference/resources/asset.html
Methods
impl Asset[src]
impl Assetpub fn identifier(&self) -> &AssetIdentifier[src]
pub fn identifier(&self) -> &AssetIdentifierThe identifier of this asset.
pub fn asset_type(&self) -> &str[src]
pub fn asset_type(&self) -> &strThe type of this asset: “credit_alphanum4”, or “credit_alphanum12”. Returns a slice that lives as long as the asset does.
pub fn code(&self) -> &str[src]
pub fn code(&self) -> &strThe code of this asset. Returns a slice that lives as long as the asset does.
pub fn issuer(&self) -> &str[src]
pub fn issuer(&self) -> &strThe issuer of this asset. This corresponds to the id of an account. Returns a slice that lives as long as the asset does.
pub fn amount(&self) -> Amount[src]
pub fn amount(&self) -> AmountThe number of units of credit issued for this asset. This number is scaled by 10 million to display the number if the format a user would expect it in.
https://www.stellar.org/developers/guides/concepts/assets.html#amount-precision-and-representation
pub fn num_accounts(&self) -> u32[src]
pub fn num_accounts(&self) -> u32The number of accounts that: 1) trust this asset and 2) where if the asset has the auth_required flag then the account is authorized to hold the asset. Returns an unsigned 32-bit integer
pub fn is_auth_required(&self) -> bool[src]
pub fn is_auth_required(&self) -> boolIf this field is true it means the anchor must approve anyone who wants to hold its credit, allowing it to control who its customers are
pub fn is_auth_revocable(&self) -> bool[src]
pub fn is_auth_revocable(&self) -> boolIf this field is true it means the anchor can freeze credit held by another account. When credit is frozen for a particular account, that account can only send the credit back to the anchor–it can’t transfer the credit to any other account. This setting allows the issuing account to revoke credit that it accidentally issued or that was obtained improperly.
pub fn flags(&self) -> Flags[src]
pub fn flags(&self) -> FlagsReturns the flags associated with this asset.
Trait Implementations
impl Debug for Asset[src]
impl Debug for Assetfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for Asset[src]
impl Clone for Assetfn clone(&self) -> Asset[src]
fn clone(&self) -> AssetReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<'de> Deserialize<'de> for Asset[src]
impl<'de> Deserialize<'de> for Assetfn deserialize<D>(d: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, [src]
fn deserialize<D>(d: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, Deserialize this value from the given Serde deserializer. Read more