referrerpolicy=no-referrer-when-downgrade
staging_xcm::v5

Trait ExecuteXcm

Source
pub trait ExecuteXcm<Call> {
    type Prepared: PreparedMessage;

    // Required methods
    fn prepare(message: Xcm<Call>) -> Result<Self::Prepared, Xcm<Call>>;
    fn execute(
        origin: impl Into<Location>,
        pre: Self::Prepared,
        id: &mut XcmHash,
        weight_credit: Weight,
    ) -> Outcome;
    fn charge_fees(location: impl Into<Location>, fees: Assets) -> Result;

    // Provided method
    fn prepare_and_execute(
        origin: impl Into<Location>,
        message: Xcm<Call>,
        id: &mut XcmHash,
        weight_limit: Weight,
        weight_credit: Weight,
    ) -> Outcome { ... }
}
Expand description

Type of XCM message executor.

Required Associated Types§

Required Methods§

Source

fn prepare(message: Xcm<Call>) -> Result<Self::Prepared, Xcm<Call>>

Source

fn execute( origin: impl Into<Location>, pre: Self::Prepared, id: &mut XcmHash, weight_credit: Weight, ) -> Outcome

Source

fn charge_fees(location: impl Into<Location>, fees: Assets) -> Result

Deduct some fees to the sovereign account of the given location and place them as per the convention for fees.

Provided Methods§

Source

fn prepare_and_execute( origin: impl Into<Location>, message: Xcm<Call>, id: &mut XcmHash, weight_limit: Weight, weight_credit: Weight, ) -> Outcome

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<C> ExecuteXcm<C> for ()

Source§

type Prepared = Weightless

Source§

fn prepare(message: Xcm<C>) -> Result<Self::Prepared, Xcm<C>>

Source§

fn execute( _: impl Into<Location>, _: Self::Prepared, _: &mut XcmHash, _: Weight, ) -> Outcome

Source§

fn charge_fees(_location: impl Into<Location>, _fees: Assets) -> Result

Implementors§

impl<Config: Config> ExecuteXcm<<Config as Config>::RuntimeCall> for XcmExecutor<Config>