Enum stellar_client::resources::AssetIdentifier [−][src]
pub enum AssetIdentifier {
Native,
CreditAlphanum4(AssetId),
CreditAlphanum12(AssetId),
}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 An identifer is the type, code, and issuer.
Variants
NativeStellar Lumens!
CreditAlphanum4(AssetId)Asset with a 4 character code
CreditAlphanum12(AssetId)Asset with a 12 character code
Methods
impl AssetIdentifier[src]
impl AssetIdentifierpub 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 asset_code(&self) -> Option<String>[src]
pub fn asset_code(&self) -> Option<String>The code of this asset as a result.
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 asset_issuer(&self) -> Option<String>[src]
pub fn asset_issuer(&self) -> Option<String>The issuer of this asset as a result
pub fn is_native(&self) -> bool[src]
pub fn is_native(&self) -> boolReturns true if this is the native lumen on the network
pub fn new(
asset_type: &str,
code: Option<String>,
issuer: Option<String>
) -> Result<AssetIdentifier, String>[src]
pub fn new(
asset_type: &str,
code: Option<String>,
issuer: Option<String>
) -> Result<AssetIdentifier, String>A new Asset can be a native stellar, or a fully identified asset
pub fn native() -> AssetIdentifier[src]
pub fn native() -> AssetIdentifierA type safe way of creating a native asset AssetIdentifier
pub fn alphanum4(code: &str, issuer: &str) -> AssetIdentifier[src]
pub fn alphanum4(code: &str, issuer: &str) -> AssetIdentifierA type safe way of creating an alphanum4 asset AssetIdentifier
pub fn alphanum12(code: &str, issuer: &str) -> AssetIdentifier[src]
pub fn alphanum12(code: &str, issuer: &str) -> AssetIdentifierA type safe way of creating an alphanum12 asset AssetIdentifier
Trait Implementations
impl Debug for AssetIdentifier[src]
impl Debug for AssetIdentifierfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for AssetIdentifier[src]
impl PartialEq for AssetIdentifierfn eq(&self, other: &AssetIdentifier) -> bool[src]
fn eq(&self, other: &AssetIdentifier) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &AssetIdentifier) -> bool[src]
fn ne(&self, other: &AssetIdentifier) -> boolThis method tests for !=.
impl Eq for AssetIdentifier[src]
impl Eq for AssetIdentifierimpl Clone for AssetIdentifier[src]
impl Clone for AssetIdentifierfn clone(&self) -> AssetIdentifier[src]
fn clone(&self) -> AssetIdentifierReturns 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 AssetIdentifier[src]
impl<'de> Deserialize<'de> for AssetIdentifierfn 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
impl Serialize for AssetIdentifier[src]
impl Serialize for AssetIdentifierfn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error> where
S: Serializer, [src]
fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error> where
S: Serializer, Serialize this value into the given Serde serializer. Read more
impl FromStr for AssetIdentifier[src]
impl FromStr for AssetIdentifiertype Err = ParseAssetIdentifierError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<AssetIdentifier, ParseAssetIdentifierError>[src]
fn from_str(s: &str) -> Result<AssetIdentifier, ParseAssetIdentifierError>Parses a string s to return a value of this type. Read more
Auto Trait Implementations
impl Send for AssetIdentifier
impl Send for AssetIdentifierimpl Sync for AssetIdentifier
impl Sync for AssetIdentifier