referrerpolicy=no-referrer-when-downgrade

Trait UpdateStrategy

pub trait UpdateStrategy {
    type UpdateValue<'a>;
    type Success;
}
Expand description

A strategy for use in the Update implementations.

The common update strategies are:

Required Associated Types§

type UpdateValue<'a>

The value to update the asset’s state. Usually, it should be related to the corresponding InspectStrategy::Value.

For instance:

  • If the Value is Vec<u8>, the UpdateValue can be Option<&'a [u8]> (e.g., asset attributes that can be modified or deleted).
  • If the Value is bool, the UpdateValue can also be bool.

type Success

This type represents a successful asset state update. It will be in the Result type of the Update::update function.

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<AccountId> UpdateStrategy for Admin<AccountId>
where AccountId: 'static,

§

impl<AccountId> UpdateStrategy for Owner<AccountId>
where AccountId: 'static,

§

impl<Condition> UpdateStrategy for CanCreate<Condition>

§

type UpdateValue<'u> = bool

§

type Success = ()

§

impl<Condition> UpdateStrategy for CanDestroy<Condition>

§

type UpdateValue<'u> = bool

§

type Success = ()

§

impl<Flavor> UpdateStrategy for CanUpdate<Flavor>

§

type UpdateValue<'u> = bool

§

type Success = ()

§

impl<Inspect, Inner> UpdateStrategy for CheckState<Inspect, Inner>
where Inspect: InspectStrategy, Inner: UpdateStrategy,

§

type UpdateValue<'u> = <Inner as UpdateStrategy>::UpdateValue<'u>

§

type Success = <Inner as UpdateStrategy>::Success

§

impl<Request> UpdateStrategy for Bytes<Request>

§

type UpdateValue<'u> = Option<&'u [u8]>

§

type Success = ()

§

impl<RuntimeOrigin, Inner> UpdateStrategy for CheckOrigin<RuntimeOrigin, Inner>
where Inner: UpdateStrategy,

§

type UpdateValue<'u> = <Inner as UpdateStrategy>::UpdateValue<'u>

§

type Success = <Inner as UpdateStrategy>::Success