Skip to main content

MoveObjectType

Struct MoveObjectType 

Source
pub struct MoveObjectType(/* private fields */);
Expand description

A StructTag with optimized BCS serialization for object types.

GasCoin, StakedIota, and Coin variants use compact enum encoding instead of the full StructTag representation. The Other variant carries the full StructTag inline.

§BCS

compressed-struct-tag = other-struct-type / gas-coin-type / staked-iota-type / coin-type
other-struct-type     = %x00 struct-tag
gas-coin-type         = %x01
staked-iota-type      = %x02
coin-type             = %x03 type-tag

Implementations§

Source§

impl MoveObjectType

Source

pub fn new(tag: StructTag) -> Self

Source

pub fn into_inner(self) -> StructTag

Methods from Deref<Target = StructTag>§

Source

pub fn is_same_type_as(&self, other: &StructTag) -> bool

Returns whether the type (excluding the type params) is the same as another struct tag.

Source

pub fn is_gas(&self) -> bool

Checks if this is a framework IOTA gas type (0x2::iota::IOTA)

Source

pub fn is_gas_coin(&self) -> bool

Checks if this is a framework gas coin type (0x2::coin::Coin<0x2::iota::IOTA>)

Source

pub fn is_id(&self) -> bool

Checks if this is a framework object ID type (0x2::object::ID)

Source

pub fn is_uid(&self) -> bool

Checks if this is a framework object UID type (0x2::object::UID)

Source

pub fn is_name(&self) -> bool

Checks if this is an IOTA-Names Name type. Note that this does not check the package address, so it will return true for any struct with the correct module and type name with no type params.

Source

pub fn is_dynamic_field(&self) -> bool

Checks if this is a Dynamic Field type (0x2::dynamic_field::Field<KeyType, ValueType>)

Source

pub fn opt_coin_type(&self) -> Option<&TypeTag>

Returns the coin type if this is a Coin type, None otherwise

Source

pub fn coin_type(&self) -> &TypeTag

Returns the coin type of this StructTag, panics if not a coin

Source

pub fn address(&self) -> Address

Returns the address part of a StructTag

Source

pub fn module(&self) -> &Identifier

Returns the module part of a StructTag

Source

pub fn name(&self) -> &Identifier

Returns the name part of a StructTag

Source

pub fn type_params(&self) -> &[TypeTag]

Returns the type params part of a StructTag

Source

pub fn is_timelocked_balance(&self) -> bool

Checks if this is a timelocked coin balance TimeLock<Balance<T>>

Source

pub fn is_gas_balance(&self) -> bool

Checks if this is an IOTA balance type (0x2::balance::Balance<0x2::iota::IOTA>)

Source

pub fn is_timelocked_gas_balance(&self) -> bool

Checks if this is a timelocked IOTA balance type (0x2::timelock::TimeLock<0x2::balance::Balance<0x2::iota::IOTA>>)

Source

pub fn to_canonical_string(&self, with_prefix: bool) -> String

Returns the string representation of this struct tag using the canonical display, with or without a 0x prefix.

Source

pub fn is_clock(&self) -> bool

Source

pub fn is_iota_treasury_cap(&self) -> bool

Source

pub fn is_kiosk(&self) -> bool

Source

pub fn is_kiosk_owner_cap(&self) -> bool

Source

pub fn is_publisher(&self) -> bool

Source

pub fn is_upgrade_cap(&self) -> bool

Source

pub fn is_upgrade_ticket(&self) -> bool

Source

pub fn is_upgrade_receipt(&self) -> bool

Source

pub fn is_random(&self) -> bool

Source

pub fn is_iota_system_admin_cap(&self) -> bool

Source

pub fn is_url(&self) -> bool

Source

pub fn is_bag(&self) -> bool

Source

pub fn is_object_bag(&self) -> bool

Source

pub fn is_tx_context(&self) -> bool

Source

pub fn is_deny_list(&self) -> bool

Source

pub fn is_transaction_deny_rules(&self) -> bool

Source

pub fn is_package_metadata_v1(&self) -> bool

Source

pub fn is_package_metadata_key(&self) -> bool

Source

pub fn is_module_metadata(&self) -> bool

Source

pub fn is_authenticator_function_ref_v1_key(&self) -> bool

Source

pub fn is_deny_list_config_key(&self) -> bool

Source

pub fn is_deny_list_address_key(&self) -> bool

Source

pub fn is_deny_list_global_pause_key(&self) -> bool

Source

pub fn is_iota_system_state(&self) -> bool

Source

pub fn is_staked_iota(&self) -> bool

Source

pub fn is_timelocked_staked_iota(&self) -> bool

Source

pub fn is_system_epoch_info_event(&self) -> bool

Source

pub fn is_unverified_validator_operation_cap(&self) -> bool

Source

pub fn is_string(&self) -> bool

Source

pub fn is_ascii_string(&self) -> bool

Source

pub fn is_coin_metadata(&self) -> bool

Source

pub fn is_treasury_cap(&self) -> bool

Source

pub fn is_coin_manager(&self) -> bool

Source

pub fn is_display_created(&self) -> bool

Source

pub fn is_display_version_updated(&self) -> bool

Source

pub fn is_coin(&self) -> bool

Source

pub fn is_regulated_coin_metadata(&self) -> bool

Source

pub fn is_deny_cap_v1(&self) -> bool

Source

pub fn is_balance(&self) -> bool

Source

pub fn is_time_lock(&self) -> bool

Source

pub fn is_config(&self) -> bool

Source

pub fn is_display(&self) -> bool

Source

pub fn is_coin_manager_treasury_cap(&self) -> bool

Source

pub fn is_coin_manager_metadata_cap(&self) -> bool

Source

pub fn is_token(&self) -> bool

Source

pub fn is_token_policy_cap(&self) -> bool

Source

pub fn is_token_policy(&self) -> bool

Source

pub fn is_transfer_policy(&self) -> bool

Source

pub fn is_transfer_policy_cap(&self) -> bool

Source

pub fn is_labeler_cap(&self) -> bool

Source

pub fn is_purchase_cap(&self) -> bool

Source

pub fn is_config_setting(&self) -> bool

Source

pub fn is_dynamic_object_field_wrapper(&self) -> bool

Source

pub fn is_transfer_receiving(&self) -> bool

Source

pub fn is_option(&self) -> bool

Source

pub fn is_alias(&self) -> bool

Source

pub fn is_nft(&self) -> bool

Source

pub fn is_irc27_metadata(&self) -> bool

Source

pub fn is_basic_output(&self) -> bool

Source

pub fn is_nft_output(&self) -> bool

Source

pub fn is_alias_output(&self) -> bool

Trait Implementations§

Source§

impl Arbitrary for MoveObjectType

Available on crate feature proptest only.
Source§

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
Source§

type Strategy = BoxedStrategy<MoveObjectType>

The type of Strategy used to generate values of type Self.
Source§

fn arbitrary_with( args_shared: <Self as Arbitrary>::Parameters, ) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
Source§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
Source§

impl Clone for MoveObjectType

Source§

fn clone(&self) -> MoveObjectType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MoveObjectType

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Deref for MoveObjectType

Source§

type Target = StructTag

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'de> Deserialize<'de> for MoveObjectType

Available on crate feature serde only.
Source§

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 Display for MoveObjectType

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for MoveObjectType

Source§

impl From<MoveObjectType> for StructTag

Source§

fn from(obj_type: MoveObjectType) -> Self

Converts to this type from the input type.
Source§

impl From<StructTag> for MoveObjectType

Source§

fn from(tag: StructTag) -> Self

Converts to this type from the input type.
Source§

impl FromStr for MoveObjectType

Source§

type Err = TypeParseError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

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

impl Hash for MoveObjectType

Source§

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

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
Source§

impl Ord for MoveObjectType

Source§

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

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for MoveObjectType

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialEq<StructTag> for MoveObjectType

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for MoveObjectType

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

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

impl Serialize for MoveObjectType

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

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

impl StructuralPartialEq for MoveObjectType

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>, U: Sized,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

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

Source§

type Error = !

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 T
where U: TryFrom<T>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V