referrerpolicy=no-referrer-when-downgrade
frame_support::traits::tokens::nonfungible_v2

Trait Mutate

Source
pub trait Mutate<AccountId, ItemConfig>: Inspect<AccountId> {
    // Provided methods
    fn mint_into(
        _item: &Self::ItemId,
        _who: &AccountId,
        _config: &ItemConfig,
        _deposit_collection_owner: bool,
    ) -> DispatchResult { ... }
    fn burn(
        _item: &Self::ItemId,
        _maybe_check_owner: Option<&AccountId>,
    ) -> DispatchResult { ... }
    fn set_attribute(
        _item: &Self::ItemId,
        _key: &[u8],
        _value: &[u8],
    ) -> DispatchResult { ... }
    fn set_typed_attribute<K: Encode, V: Encode>(
        item: &Self::ItemId,
        key: &K,
        value: &V,
    ) -> DispatchResult { ... }
    fn set_metadata(
        _who: &AccountId,
        _item: &Self::ItemId,
        _data: &[u8],
    ) -> DispatchResult { ... }
    fn clear_attribute(_item: &Self::ItemId, _key: &[u8]) -> DispatchResult { ... }
    fn clear_typed_attribute<K: Encode>(
        item: &Self::ItemId,
        key: &K,
    ) -> DispatchResult { ... }
    fn clear_metadata(_who: &AccountId, _item: &Self::ItemId) -> DispatchResult { ... }
}
Expand description

Trait for providing an interface for NFT-like items which may be minted, burned and/or have attributes and metadata set on them.

Provided Methods§

Source

fn mint_into( _item: &Self::ItemId, _who: &AccountId, _config: &ItemConfig, _deposit_collection_owner: bool, ) -> DispatchResult

Mint some item to be owned by who.

By default, this is not a supported operation.

Source

fn burn( _item: &Self::ItemId, _maybe_check_owner: Option<&AccountId>, ) -> DispatchResult

Burn some item.

By default, this is not a supported operation.

Source

fn set_attribute( _item: &Self::ItemId, _key: &[u8], _value: &[u8], ) -> DispatchResult

Set attribute value of item’s key.

By default, this is not a supported operation.

Source

fn set_typed_attribute<K: Encode, V: Encode>( item: &Self::ItemId, key: &K, value: &V, ) -> DispatchResult

Attempt to set the strongly-typed attribute value of item’s key.

By default this just attempts to use set_attribute.

Source

fn set_metadata( _who: &AccountId, _item: &Self::ItemId, _data: &[u8], ) -> DispatchResult

Set the metadata data of an item.

By default, this is not a supported operation.

Source

fn clear_attribute(_item: &Self::ItemId, _key: &[u8]) -> DispatchResult

Clear attribute of item’s key.

By default, this is not a supported operation.

Source

fn clear_typed_attribute<K: Encode>( item: &Self::ItemId, key: &K, ) -> DispatchResult

Attempt to clear the strongly-typed attribute of item’s key.

By default this just attempts to use clear_attribute.

Source

fn clear_metadata(_who: &AccountId, _item: &Self::ItemId) -> DispatchResult

Clear the metadata of an item.

By default, this is not a supported operation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F: Mutate<AccountId, ItemConfig>, A: Get<<F as Inspect<AccountId>>::CollectionId>, AccountId, ItemConfig> Mutate<AccountId, ItemConfig> for ItemOf<F, A, AccountId>