referrerpolicy=no-referrer-when-downgrade

Trait staging_xcm_builder::ExecuteController

source ·
pub trait ExecuteController<Origin, RuntimeCall> {
    type WeightInfo: ExecuteControllerWeightInfo;

    // Required method
    fn execute(
        origin: Origin,
        message: Box<VersionedXcm<RuntimeCall>>,
        max_weight: Weight,
    ) -> Result<Weight, DispatchErrorWithPostInfo>;
}
Expand description

Execute an XCM locally, for a given origin.

An implementation of that trait will handle the low-level details of the execution, such as:

  • Validating and Converting the origin to a Location.
  • Handling versioning.
  • Calling the internal executor, which implements ExecuteXcm.

Required Associated Types§

source

type WeightInfo: ExecuteControllerWeightInfo

Weight information for ExecuteController functions.

Required Methods§

source

fn execute( origin: Origin, message: Box<VersionedXcm<RuntimeCall>>, max_weight: Weight, ) -> Result<Weight, DispatchErrorWithPostInfo>

Attempt to execute an XCM locally, returns Ok with the weight consumed if the execution complete successfully, Err otherwise.

§Parameters
  • origin: the origin of the call.
  • message: the XCM program to be executed.
  • max_weight: the maximum weight that can be consumed by the execution.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<Origin, RuntimeCall> ExecuteController<Origin, RuntimeCall> for ()

§

type WeightInfo = ()

source§

fn execute( _origin: Origin, _message: Box<VersionedXcm<RuntimeCall>>, _max_weight: Weight, ) -> Result<Weight, DispatchErrorWithPostInfo>

Implementors§