referrerpolicy=no-referrer-when-downgrade

Module common_strategies

Expand description

This module contains the common asset ops strategies.

Structs§

Admin
The Admin strategy is both inspect and update strategy allows getting and setting the admin of an asset.
Bytes
The Bytes strategy represents raw state bytes. It is both an inspect and update strategy.
CanCreate
The CanCreate strategy represents the ability to create an asset. It is both an inspect and update strategy.
CanDestroy
The CanDestroy strategy represents the ability to destroy an asset. It is both an inspect and update strategy.
CanUpdate
The CanUpdate strategy represents the ability to update the state of an asset. It is both an inspect and update strategy.
CheckOrigin
The CheckOrigin is a strategy that accepts a runtime origin and the Inner strategy.
CheckState
The CheckState is a strategy that accepts an Inspect value and the Inner strategy.
ConfigValue
Represents the value of an InspectStrategy to be used as a configuration value in the WithConfig strategy.
DeriveAndReportId
The DeriveAndReportId is an ID assignment approach intended to be used in "create" strategies.
DeriveStrategyThenCreate
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 Owner strategy is both inspect and update strategy allows getting and setting the owner of an asset.
WithConfig
The WithConfig is 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 Witness strategy is an inspect strategy, which gets the specified WitnessData from the asset.

Traits§

AsCanUpdate
This trait converts the given UpdateStrategy into the corresponding CanUpdate strategy representing the ability to update the asset using the provided strategy.
ConfigValueMarker
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.
WithConfigValue
This trait converts the given InspectStrategy into the config value to be used in the WithConfig strategy.

Type Aliases§

AutoId
The AutoId is an ID assignment approach intended to be used in "create" strategies.
ChangeOwnerFrom
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::update function.
IfOwnedBy
The operation implementation must check if the given account owns the asset and act according to the inner strategy.
PredefinedId
The PredefinedId is an ID assignment approach intended to be used in "create" strategies.
WithWitness
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.