Trait AnyEventPayload
pub trait AnyEventPayload {
const SOURCES: &'static [Option<&'static str>];
const EVENT_TYPES: &'static [u16];
// Provided method
fn event_sources() -> Vec<&'static str> { ... }
}
Expand description
A trait to identify a group of event payloads, each having a unique identifier and source.
Required Associated Constants§
const SOURCES: &'static [Option<&'static str>]
const SOURCES: &'static [Option<&'static str>]
The sources of the events that this payload type can represent.
const EVENT_TYPES: &'static [u16]
const EVENT_TYPES: &'static [u16]
The event types that this payload type can represent.
Provided Methods§
fn event_sources() -> Vec<&'static str>
fn event_sources() -> Vec<&'static str>
Get all the event sources for this payload type
This is intended for internal use only. If all the items in SOURCES
are Some()
,
the function returns the inner strings with duplicates removed. If any item is None
(indicating a supported event may come from any source), an empty vector is returned
(again, indicating all sources).
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.