Trait frame_support::traits::tokens::nonfungibles::Inspect[][src]

pub trait Inspect<AccountId> {
    type InstanceId;
    type ClassId;
    fn owner(
        class: &Self::ClassId,
        instance: &Self::InstanceId
    ) -> Option<AccountId>; fn class_owner(_class: &Self::ClassId) -> Option<AccountId> { ... }
fn attribute(
        _class: &Self::ClassId,
        _instance: &Self::InstanceId,
        _key: &[u8]
    ) -> Option<Vec<u8>> { ... }
fn typed_attribute<K: Encode, V: Decode>(
        class: &Self::ClassId,
        instance: &Self::InstanceId,
        key: &K
    ) -> Option<V> { ... }
fn class_attribute(_class: &Self::ClassId, _key: &[u8]) -> Option<Vec<u8>> { ... }
fn typed_class_attribute<K: Encode, V: Decode>(
        class: &Self::ClassId,
        key: &K
    ) -> Option<V> { ... }
fn can_transfer(
        _class: &Self::ClassId,
        _instance: &Self::InstanceId
    ) -> bool { ... } }
Expand description

Trait for providing an interface to many read-only NFT-like sets of asset instances.

Associated Types

Type for identifying an asset instance.

Type for identifying an asset class (an identifier for an independent collection of asset instances).

Required methods

Returns the owner of asset instance of class, or None if the asset doesn’t exist (or somehow has no owner).

Provided methods

Returns the owner of the asset class, if there is one. For many NFTs this may not make any sense, so users of this API should not be surprised to find an asset class results in None here.

Returns the attribute value of instance of class corresponding to key.

By default this is None; no attributes are defined.

Returns the strongly-typed attribute value of instance of class corresponding to key.

By default this just attempts to use attribute.

Returns the attribute value of class corresponding to key.

By default this is None; no attributes are defined.

Returns the strongly-typed attribute value of class corresponding to key.

By default this just attempts to use class_attribute.

Returns true if the asset instance of class may be transferred.

Default implementation is that all assets are transferable.

Implementors