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

Trait Update

Source
pub trait Update<Strategy: UpdateStrategy>: AssetDefinition {
    // Required method
    fn update(
        id: &Self::Id,
        strategy: Strategy,
        update_value: Strategy::UpdateValue<'_>,
    ) -> Result<Strategy::Success, DispatchError>;
}
Expand description

A trait representing the ability of a certain asset to update its state information.

This trait can be implemented multiple times using different update strategies.

An update strategy defines how the asset state is identified and what UpdateValue type is used.

Required Methods§

Source

fn update( id: &Self::Id, strategy: Strategy, update_value: Strategy::UpdateValue<'_>, ) -> Result<Strategy::Success, DispatchError>

Update the state information of the asset using the given id, the update strategy, and the strategy’s update_value.

The ID type is retrieved from the AssetDefinition.

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§

impl<T: Config<I>, I: 'static> Update<CheckOrigin<<T as Config>::RuntimeOrigin, Owner<<T as Config>::AccountId>>> for Item<Pallet<T, I>>

impl<T: Config<I>, I: 'static> Update<CheckState<Owner<<T as Config>::AccountId>, Owner<<T as Config>::AccountId>>> for Item<Pallet<T, I>>

impl<T: Config<I>, I: 'static> Update<Owner<<T as Config>::AccountId>> for Item<Pallet<T, I>>