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§
Sourcetype WeightInfo: ExecuteControllerWeightInfo
type WeightInfo: ExecuteControllerWeightInfo
Weight information for ExecuteController functions.
Required Methods§
Sourcefn execute(
origin: Origin,
message: Box<VersionedXcm<RuntimeCall>>,
max_weight: Weight,
) -> Result<Weight, DispatchErrorWithPostInfo>
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.