referrerpolicy=no-referrer-when-downgrade
staging_xcm_builder

Trait 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.

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.

Implementations on Foreign Types§

Source§

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

Source§

type WeightInfo = ()

Source§

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

Implementors§

impl<T: Config> ExecuteController<<T as Config>::RuntimeOrigin, <T as Config>::RuntimeCall> for Pallet<T>