referrerpolicy=no-referrer-when-downgrade
staging_xcm_executor::traits

Trait EventEmitter

Source
pub trait EventEmitter {
    // Required methods
    fn emit_sent_event(
        origin: Location,
        destination: Location,
        message: Option<Xcm<()>>,
        message_id: XcmHash,
    );
    fn emit_send_failure_event(
        origin: Location,
        destination: Location,
        error: SendError,
        message_id: XcmHash,
    );
    fn emit_process_failure_event(
        origin: Location,
        error: XcmError,
        message_id: XcmHash,
    );
}
Expand description

Defines the event emitter for the XCM executor. This trait allows implementations to emit events related to XCM handling, including successful sends and failure cases.

Required Methods§

Source

fn emit_sent_event( origin: Location, destination: Location, message: Option<Xcm<()>>, message_id: XcmHash, )

Emits an event when an XCM is successfully sent.

§Parameters
  • origin: The origin location of the XCM.
  • destination: The target location where the message is sent.
  • message: Some(Xcm) for pallet_xcm::Event::Sent, None for other events to reduce
  • message_id: A unique identifier for the XCM. storage.
Source

fn emit_send_failure_event( origin: Location, destination: Location, error: SendError, message_id: XcmHash, )

Emits an event when an XCM fails to send.

§Parameters
  • origin: The origin location of the XCM.
  • destination: The intended target location.
  • error: The error encountered while sending.
  • message_id: The unique identifier for the failed message.
Source

fn emit_process_failure_event( origin: Location, error: XcmError, message_id: XcmHash, )

Emits an event when an XCM fails to process.

§Parameters
  • origin: The origin location of the message.
  • error: The error encountered while processing.
  • message_id: The unique identifier for the failed message.

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 EventEmitter for ()

A no-op implementation of EventEmitter for unit type (). This can be used when event emission is not required.

Source§

fn emit_sent_event( _origin: Location, _destination: Location, _message: Option<Xcm<()>>, _message_id: XcmHash, )

Source§

fn emit_send_failure_event( _origin: Location, _destination: Location, _error: SendError, _message_id: XcmHash, )

Source§

fn emit_process_failure_event( _origin: Location, _error: XcmError, _message_id: XcmHash, )

Implementors§

impl<T: Config> EventEmitter for Pallet<T>