referrerpolicy=no-referrer-when-downgrade

Trait Update

pub trait Update<Strategy>: AssetDefinition
where Strategy: UpdateStrategy,
{ // Required method fn update( id: &Self::Id, strategy: Strategy, update_value: <Strategy as UpdateStrategy>::UpdateValue<'_>, ) -> Result<<Strategy as UpdateStrategy>::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§

fn update( id: &Self::Id, strategy: Strategy, update_value: <Strategy as UpdateStrategy>::UpdateValue<'_>, ) -> Result<<Strategy as UpdateStrategy>::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<Id, M, S, Op> Update<S> for MapId<Id, <Op as AssetDefinition>::Id, M, Op>
where M: Convert<Id, Result<<Op as AssetDefinition>::Id, DispatchError>>, S: UpdateStrategy, Op: Update<S>, <MapId<Id, <Op as AssetDefinition>::Id, M, Op> as AssetDefinition>::Id: Clone,

§

impl<O, E, S, Op> Update<CheckOrigin<O, S>> for UseEnsuredOrigin<E, Op>
where E: EnsureOriginWithArg<O, S>, S: UpdateStrategy, Op: Update<S>,

§

impl<StashAccount, UpdateOp> Update<CheckState<Owner<<StashAccount as TypedGet>::Type>, Owner<<StashAccount as TypedGet>::Type>>> for StashAccountAssetOps<StashAccount, UpdateOp>
where StashAccount: TypedGet, <StashAccount as TypedGet>::Type: 'static, UpdateOp: Update<CheckState<Owner<<StashAccount as TypedGet>::Type>, Owner<<StashAccount as TypedGet>::Type>>>,

§

impl<Strategy, RestoreOp, UpdateOp, StashOp> Update<Strategy> for CombinedAssetOps<RestoreOp, UpdateOp, StashOp>
where Strategy: UpdateStrategy, UpdateOp: Update<Strategy, Id = <RestoreOp as AssetDefinition>::Id> + AssetDefinition, RestoreOp: AssetDefinition, StashOp: AssetDefinition<Id = <RestoreOp as AssetDefinition>::Id>,