referrerpolicy=no-referrer-when-downgrade

Trait polkadot_sdk_frame::traits::tokens::nonfungible::Mutate

pub trait Mutate<AccountId>: Inspect<AccountId> {
    // Provided methods
    fn mint_into(
        _item: &Self::ItemId,
        _who: &AccountId,
    ) -> Result<(), DispatchError> { ... }
    fn burn(
        _item: &Self::ItemId,
        _maybe_check_owner: Option<&AccountId>,
    ) -> Result<(), DispatchError> { ... }
    fn set_attribute(
        _item: &Self::ItemId,
        _key: &[u8],
        _value: &[u8],
    ) -> Result<(), DispatchError> { ... }
    fn set_typed_attribute<K, V>(
        item: &Self::ItemId,
        key: &K,
        value: &V,
    ) -> Result<(), DispatchError>
       where K: Encode,
             V: Encode { ... }
}
Expand description

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

Provided Methods§

fn mint_into( _item: &Self::ItemId, _who: &AccountId, ) -> Result<(), DispatchError>

Mint some item to be owned by who.

By default, this is not a supported operation.

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

Burn some item.

By default, this is not a supported operation.

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

Set attribute value of item’s key.

By default, this is not a supported operation.

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

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

By default this just attempts to use set_attribute.

Object Safety§

This trait is not object safe.

Implementors§

§

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