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§
Sourcefn emit_sent_event(
origin: Location,
destination: Location,
message: Option<Xcm<()>>,
message_id: XcmHash,
)
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)
forpallet_xcm::Event::Sent
,None
for other events to reducemessage_id
: A unique identifier for the XCM. storage.
Sourcefn emit_send_failure_event(
origin: Location,
destination: Location,
error: SendError,
message_id: XcmHash,
)
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.
Sourcefn emit_process_failure_event(
origin: Location,
error: XcmError,
message_id: XcmHash,
)
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 ()
impl EventEmitter for ()
A no-op implementation of EventEmitter
for unit type ()
.
This can be used when event emission is not required.