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§
Sourcefn update(
id: &Self::Id,
strategy: Strategy,
update_value: Strategy::UpdateValue<'_>,
) -> Result<Strategy::Success, DispatchError>
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.