pub struct CoinMetadata<T: MoveType> {
pub id: UID,
pub decimals: u8,
pub name: String,
pub symbol: String,
pub description: String,
pub icon_url: Option<Url>,
/* private fields */
}
Expand description
Each Coin type T created through create_currency
function will have a
unique instance of CoinMetadata<T>
that stores the metadata for this coin type.
Fields§
§id: UID
§decimals: u8
Number of decimal places the coin uses.
A coin with value
N and decimals
D should be shown as N / 10^D
E.g., a coin with value
7002 and decimals 3 should be displayed as 7.002
This is metadata for display usage only.
name: String
Name for the token
symbol: String
Symbol for the token
description: String
Description of the token
icon_url: Option<Url>
URL for the token logo
Implementations§
Source§impl<T: MoveType> CoinMetadata<T>
impl<T: MoveType> CoinMetadata<T>
Source§impl<T: MoveType> CoinMetadata<T>
impl<T: MoveType> CoinMetadata<T>
pub fn move_instance(self, t: <T as MoveType>::TypeTag) -> MoveInstance<Self>
pub fn type_(t: <T as MoveType>::TypeTag) -> CoinMetadataTypeTag<T>
Trait Implementations§
Source§impl<T: Clone + MoveType> Clone for CoinMetadata<T>
impl<T: Clone + MoveType> Clone for CoinMetadata<T>
Source§fn clone(&self) -> CoinMetadata<T>
fn clone(&self) -> CoinMetadata<T>
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<'de, T: MoveType> Deserialize<'de> for CoinMetadata<T>
impl<'de, T: MoveType> Deserialize<'de> for CoinMetadata<T>
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<T: MoveType> Display for CoinMetadata<T>
impl<T: MoveType> Display for CoinMetadata<T>
Source§impl<T: MoveType> MoveStruct for CoinMetadata<T>
impl<T: MoveType> MoveStruct for CoinMetadata<T>
type StructTag = CoinMetadataTypeTag<T>
Source§impl<T: MoveType> MoveType for CoinMetadata<T>
impl<T: MoveType> MoveType for CoinMetadata<T>
Source§impl<T: MoveType> Serialize for CoinMetadata<T>
impl<T: MoveType> Serialize for CoinMetadata<T>
Source§impl<T: MoveType> StaticAddress for CoinMetadata<T>
impl<T: MoveType> StaticAddress for CoinMetadata<T>
Source§impl<T: MoveType> StaticModule for CoinMetadata<T>
impl<T: MoveType> StaticModule for CoinMetadata<T>
fn module() -> Identifier
Source§impl<T: MoveType> StaticName for CoinMetadata<T>
impl<T: MoveType> StaticName for CoinMetadata<T>
fn name() -> Identifier
Source§impl<T: MoveType + StaticTypeTag> StaticTypeParams for CoinMetadata<T>
impl<T: MoveType + StaticTypeTag> StaticTypeParams for CoinMetadata<T>
fn type_params() -> Vec<TypeTag>
Source§impl<T: MoveType> Tabled for CoinMetadata<T>
impl<T: MoveType> Tabled for CoinMetadata<T>
impl<T: Eq + MoveType> Eq for CoinMetadata<T>
impl<T: MoveType> StructuralPartialEq for CoinMetadata<T>
Auto Trait Implementations§
impl<T> Freeze for CoinMetadata<T>
impl<T> RefUnwindSafe for CoinMetadata<T>where
T: RefUnwindSafe,
impl<T> Send for CoinMetadata<T>where
T: Send,
impl<T> Sync for CoinMetadata<T>where
T: Sync,
impl<T> Unpin for CoinMetadata<T>where
T: Unpin,
impl<T> UnwindSafe for CoinMetadata<T>where
T: UnwindSafe,
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