pub struct TokenIdUnit();
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 Unit for representing token IDs, which means only one
token ID can be represented with this type and other token IDs cannot be
represented. For a more general token ID type see TokenIdVec
.
Trait Implementations§
Source§impl Clone for TokenIdUnit
impl Clone for TokenIdUnit
Source§fn clone(&self) -> TokenIdUnit
fn clone(&self) -> TokenIdUnit
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 Debug for TokenIdUnit
impl Debug for TokenIdUnit
Source§impl Deserial for TokenIdUnit
The TokenIdUnit
will deserialize one byte ensuring this contains the value
0. It will result in an error if the byte is not 0.
impl Deserial for TokenIdUnit
The TokenIdUnit
will deserialize one byte ensuring this contains the value
0. It will result in an error if the byte is not 0.
Source§impl<'de> Deserialize<'de> for TokenIdUnit
impl<'de> Deserialize<'de> for TokenIdUnit
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<TokenIdUnit> for String
impl From<TokenIdUnit> for String
Source§fn from(_id: TokenIdUnit) -> Self
fn from(_id: TokenIdUnit) -> Self
Converts to this type from the input type.
Source§impl Hash for TokenIdUnit
impl Hash for TokenIdUnit
Source§impl Ord for TokenIdUnit
impl Ord for TokenIdUnit
Source§fn cmp(&self, other: &TokenIdUnit) -> Ordering
fn cmp(&self, other: &TokenIdUnit) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TokenIdUnit
impl PartialEq for TokenIdUnit
Source§impl PartialOrd for TokenIdUnit
impl PartialOrd for TokenIdUnit
Source§impl SchemaType for TokenIdUnit
impl SchemaType for TokenIdUnit
Source§impl Serial for TokenIdUnit
The TokenIdUnit
is serialized with one byte with the value 0.
impl Serial for TokenIdUnit
The TokenIdUnit
is serialized with one byte with the value 0.
Source§impl Serialize for TokenIdUnit
impl Serialize for TokenIdUnit
Source§impl TryFrom<String> for TokenIdUnit
impl TryFrom<String> for TokenIdUnit
impl Copy for TokenIdUnit
impl Eq for TokenIdUnit
impl IsTokenId for TokenIdUnit
impl StructuralPartialEq for TokenIdUnit
Auto Trait Implementations§
impl Freeze for TokenIdUnit
impl RefUnwindSafe for TokenIdUnit
impl Send for TokenIdUnit
impl Sync for TokenIdUnit
impl Unpin for TokenIdUnit
impl UnwindSafe for TokenIdUnit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<D, S> DeserialWithState<S> for Dwhere
D: Deserial,
S: HasStateApi,
impl<D, S> DeserialWithState<S> for Dwhere
D: Deserial,
S: HasStateApi,
Source§fn deserial_with_state<R>(_state: &S, source: &mut R) -> Result<D, ParseError>where
R: Read,
fn deserial_with_state<R>(_state: &S, source: &mut R) -> Result<D, ParseError>where
R: Read,
Attempt to read a structure from a given source and state, failing if
an error occurs during deserialization or reading.