pub struct TokenId(/* private fields */);
Expand description

Token Id, used to identify different assets on on the blockchain.

Implementations§

§

impl TokenId

pub const MOB: TokenId = _

Represents the MobileCoin token id for MOB token

pub const NUM_BYTES: usize = 8usize

Represents the number of bytes in a well-formed TokenId

Methods from Deref<Target = u64>§

1.43.0 · source

pub const MIN: u64 = 0u64

1.43.0 · source

pub const MAX: u64 = 18_446_744_073_709_551_615u64

1.53.0 · source

pub const BITS: u32 = 64u32

Trait Implementations§

§

impl Clone for TokenId

§

fn clone(&self) -> TokenId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl ConditionallySelectable for TokenId

§

fn conditional_select(a: &TokenId, b: &TokenId, choice: Choice) -> TokenId

Select a or b according to choice. Read more
source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
§

impl ConstantTimeEq for TokenId

§

fn ct_eq(&self, other: &TokenId) -> Choice

Determine if two items are equal. Read more
§

impl Debug for TokenId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Deref for TokenId

§

type Target = u64

The resulting type after dereferencing.
§

fn deref(&self) -> &<TokenId as Deref>::Target

Dereferences the value.
§

impl<'de> Deserialize<'de> for TokenId

§

fn deserialize<__D>( __deserializer: __D ) -> Result<TokenId, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Digestible for TokenId

§

fn append_to_transcript<DT>(&self, context: &'static [u8], transcript: &mut DT)where DT: DigestTranscript,

Add the data from self to the transcript Context should be a string-literal
§

fn digest32<DT>(&self, context: &'static [u8]) -> [u8; 32]where DT: DigestTranscript,

Simply get a 32-byte hash using a one-off digest transcript. Read more
§

fn append_to_transcript_allow_omit<DT>( &self, context: &'static [u8], transcript: &mut DT )where DT: DigestTranscript,

To support schema evolution, in some contexts the generated code for a Digestible implementation of a compound type should append its children to the transcript, but allow them to skip themselves if they are empty. For members of a struct, this is allowed, because they don’t have a fixed set of members but for a variant it isn’t allowed, because the value cannot be omitted. Read more
§

impl Display for TokenId

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<&u64> for TokenId

§

fn from(src: &u64) -> TokenId

Converts to this type from the input type.
§

impl From<u64> for TokenId

§

fn from(src: u64) -> TokenId

Converts to this type from the input type.
§

impl FromStr for TokenId

§

type Err = ParseIntError

The associated error which can be returned from parsing.
§

fn from_str(src: &str) -> Result<TokenId, <TokenId as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for TokenId

§

fn hash<__H>(&self, state: &mut __H)where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for TokenId

§

fn cmp(&self, other: &TokenId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
§

impl PartialEq<TokenId> for TokenId

§

fn eq(&self, other: &TokenId) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<TokenId> for u64

§

fn eq(&self, other: &TokenId) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialEq<u64> for TokenId

§

fn eq(&self, other: &u64) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialOrd<TokenId> for TokenId

§

fn partial_cmp(&self, other: &TokenId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Serialize for TokenId

§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Zeroize for TokenId

§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
§

impl Copy for TokenId

§

impl Eq for TokenId

§

impl StructuralEq for TokenId

§

impl StructuralPartialEq for TokenId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,