pub trait Inspect<AccountId> {
    type ItemId;

    fn owner(item: &Self::ItemId) -> Option<AccountId>;

    fn attribute(_item: &Self::ItemId, _key: &[u8]) -> Option<Vec<u8>> { ... }
    fn typed_attribute<K: Encode, V: Decode>(
        item: &Self::ItemId,
        key: &K
    ) -> Option<V> { ... } fn can_transfer(_item: &Self::ItemId) -> bool { ... } }
Expand description

Trait for providing an interface to a read-only NFT-like set of items.

Required Associated Types

Type for identifying an item.

Required Methods

Returns the owner of item, or None if the item doesn’t exist or has no owner.

Provided Methods

Returns the attribute value of item corresponding to key.

By default this is None; no attributes are defined.

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

By default this just attempts to use attribute.

Returns true if the item may be transferred.

Default implementation is that all items are transferable.

Implementors