Expand description
This module contains the common asset ops strategies.
Structs§
- Admin
- The
Adminstrategy is both inspect and update strategy allows getting and setting the admin of an asset. - Bytes
- The
Bytesstrategy represents raw state bytes. It is both an inspect and update strategy. - CanCreate
- The
CanCreatestrategy represents the ability to create an asset. It is both an inspect and update strategy. - CanDestroy
- The
CanDestroystrategy represents the ability to destroy an asset. It is both an inspect and update strategy. - CanUpdate
- The
CanUpdatestrategy represents the ability to update the state of an asset. It is both an inspect and update strategy. - Check
Origin - The
CheckOriginis a strategy that accepts a runtime origin and theInnerstrategy. - Check
State - The
CheckStateis a strategy that accepts anInspectvalue and theInnerstrategy. - Config
Value - Represents the value of an InspectStrategy to be used as a configuration value in the WithConfig strategy.
- Derive
AndReport Id - The
DeriveAndReportIdis an ID assignment approach intended to be used in"create" strategies. - Derive
Strategy Then Create - This adapter allows one to derive a CreateStrategy value from the ID derivation parameters from the DeriveAndReportId.
- NoParams
- The NoParams represents the simplest state-mutating strategy, which doesn’t require any parameters to perform the operation.
- Owner
- The
Ownerstrategy is both inspect and update strategy allows getting and setting the owner of an asset. - With
Config - The
WithConfigis a create and restore strategy. It facilitates setting the asset’s properties that can be later inspected via the corresponding inspect strategies. The provided asset’s properties are considered its config. Every inspect strategy can be used to create a config value. - Witness
- The
Witnessstrategy is an inspect strategy, which gets the specifiedWitnessDatafrom the asset.
Traits§
- AsCan
Update - This trait converts the given UpdateStrategy into the corresponding CanUpdate strategy representing the ability to update the asset using the provided strategy.
- Config
Value Marker - This trait marks a config value to be used in the WithConfig strategy. It is used to make compiler error messages clearer if invalid type is supplied into the WithConfig.
- With
Config Value - This trait converts the given InspectStrategy into the config value to be used in the WithConfig strategy.
Type Aliases§
- AutoId
- The
AutoIdis an ID assignment approach intended to be used in"create" strategies. - Change
Owner From - The operation implementation must check
if the given account owns the asset and only then perform the owner update to the one supplied
to the
Update::updatefunction. - IfOwned
By - The operation implementation must check if the given account owns the asset and act according to the inner strategy.
- Predefined
Id - The
PredefinedIdis an ID assignment approach intended to be used in"create" strategies. - With
Witness - The operation implementation must check if the given witness represents the correct state of the asset. If so, the operation must act according to the inner strategy.