Trait frame::traits::tokens::nonfungible_v2::Inspect
pub trait Inspect<AccountId> {
type ItemId: Parameter;
// Required method
fn owner(item: &Self::ItemId) -> Option<AccountId>;
// Provided methods
fn attribute(_item: &Self::ItemId, _key: &[u8]) -> Option<Vec<u8, Global>> { ... }
fn custom_attribute(
_account: &AccountId,
_item: &Self::ItemId,
_key: &[u8]
) -> Option<Vec<u8, Global>> { ... }
fn system_attribute(
_item: &Self::ItemId,
_key: &[u8]
) -> Option<Vec<u8, Global>> { ... }
fn typed_attribute<K, V>(item: &Self::ItemId, key: &K) -> Option<V>
where K: Encode,
V: Decode { ... }
fn typed_custom_attribute<K, V>(
account: &AccountId,
item: &Self::ItemId,
key: &K
) -> Option<V>
where K: Encode,
V: Decode { ... }
fn typed_system_attribute<K, V>(item: &Self::ItemId, key: &K) -> Option<V>
where K: Encode,
V: Decode { ... }
fn can_transfer(_item: &Self::ItemId) -> bool { ... }
}Expand description
Trait for providing an interface to a read-only NFT-like item.
Required Associated Types§
type ItemId: Parameter
type ItemId: Parameter
Type for identifying an item.
Required Methods§
Provided Methods§
fn attribute(_item: &Self::ItemId, _key: &[u8]) -> Option<Vec<u8, Global>>
fn attribute(_item: &Self::ItemId, _key: &[u8]) -> Option<Vec<u8, Global>>
Returns the attribute value of item corresponding to key.
By default this is None; no attributes are defined.
fn custom_attribute(
_account: &AccountId,
_item: &Self::ItemId,
_key: &[u8]
) -> Option<Vec<u8, Global>>
fn custom_attribute( _account: &AccountId, _item: &Self::ItemId, _key: &[u8] ) -> Option<Vec<u8, Global>>
Returns the custom attribute value of item corresponding to key.
By default this is None; no attributes are defined.
fn system_attribute(
_item: &Self::ItemId,
_key: &[u8]
) -> Option<Vec<u8, Global>>
fn system_attribute( _item: &Self::ItemId, _key: &[u8] ) -> Option<Vec<u8, Global>>
Returns the system attribute value of item corresponding to key.
By default this is None; no attributes are defined.
fn typed_attribute<K, V>(item: &Self::ItemId, key: &K) -> Option<V>where
K: Encode,
V: Decode,
fn typed_attribute<K, V>(item: &Self::ItemId, key: &K) -> Option<V>where K: Encode, V: Decode,
Returns the strongly-typed attribute value of item corresponding to key.
By default this just attempts to use attribute.
fn typed_custom_attribute<K, V>(
account: &AccountId,
item: &Self::ItemId,
key: &K
) -> Option<V>where
K: Encode,
V: Decode,
fn typed_custom_attribute<K, V>( account: &AccountId, item: &Self::ItemId, key: &K ) -> Option<V>where K: Encode, V: Decode,
Returns the strongly-typed custom attribute value of item corresponding to key.
By default this just attempts to use custom_attribute.
fn typed_system_attribute<K, V>(item: &Self::ItemId, key: &K) -> Option<V>where
K: Encode,
V: Decode,
fn typed_system_attribute<K, V>(item: &Self::ItemId, key: &K) -> Option<V>where K: Encode, V: Decode,
Returns the strongly-typed system attribute value of item corresponding to key.
By default this just attempts to use system_attribute.
fn can_transfer(_item: &Self::ItemId) -> bool
fn can_transfer(_item: &Self::ItemId) -> bool
Returns true if the item may be transferred.
Default implementation is that all items are transferable.