Struct concordium_cis2::TokenIdU16
source · pub struct TokenIdU16(pub u16);
Expand description
Token Identifier, which combined with the address of the contract instance, forms the unique identifier of a token type.
The CIS2 specification allows for up to 255 bytes for the token ID, but for most cases using a smaller token ID is fine and can reduce contract energy costs.
This token ID uses u16 for representing the token ID bytes which means the
token ID space is fixed to 2 bytes and some token IDs cannot be represented.
For a more general token ID type see TokenIdVec
.
Tuple Fields§
§0: u16
Trait Implementations§
source§impl Clone for TokenIdU16
impl Clone for TokenIdU16
source§fn clone(&self) -> TokenIdU16
fn clone(&self) -> TokenIdU16
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TokenIdU16
impl Debug for TokenIdU16
source§impl Deserial for TokenIdU16
impl Deserial for TokenIdU16
The TokenIdU16
will deserialize one byte ensuring this contains the value
2 and then deserialize a u16 as little endian. It will result in an error if
the first byte is not 2.
source§impl Display for TokenIdU16
impl Display for TokenIdU16
Display the token ID as a uppercase hex string
source§impl From<u16> for TokenIdU16
impl From<u16> for TokenIdU16
source§impl Hash for TokenIdU16
impl Hash for TokenIdU16
source§impl Ord for TokenIdU16
impl Ord for TokenIdU16
source§fn cmp(&self, other: &TokenIdU16) -> Ordering
fn cmp(&self, other: &TokenIdU16) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for TokenIdU16
impl PartialEq for TokenIdU16
source§fn eq(&self, other: &TokenIdU16) -> bool
fn eq(&self, other: &TokenIdU16) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TokenIdU16
impl PartialOrd for TokenIdU16
source§fn partial_cmp(&self, other: &TokenIdU16) -> Option<Ordering>
fn partial_cmp(&self, other: &TokenIdU16) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serial for TokenIdU16
impl Serial for TokenIdU16
The TokenIdU16
is serialized with one byte with the value 2 followed by 2
bytes to encode a u16 in little endian.