Trait EventPayload
pub trait EventPayload {
const ID: u16;
const SOURCE: Option<&'static str>;
}
Expand description
A trait to identify event payloads in the plugin framework.
Each event has two main identifiers:
ID
: a unique identifier for the event type, which is a 16-bit unsigned integer.SOURCE
: the name of the event source. For plugin events, this is the name of the plugin that generated the event. For syscall events, this is alwaysSome("syscall")
.
The source can be None
if the event can come from multiple sources, such as in the case of
async or plugin events coming from different plugins.
Required Associated Constants§
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.