Trait AnyEventPayload

Source
pub trait AnyEventPayload {
    const SOURCES: &'static [Option<&'static str>];
    const EVENT_TYPES: &'static [u16];

    // Provided method
    fn event_sources() -> Vec<&'static str> { ... }
}

Required Associated Constants§

Source

const SOURCES: &'static [Option<&'static str>]

Source

const EVENT_TYPES: &'static [u16]

Provided Methods§

Source

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.

Implementors§

Source§

impl AnyEventPayload for RawEvent<'_>

Source§

const SOURCES: &'static [Option<&'static str>]

Source§

const EVENT_TYPES: &'static [u16]

Source§

impl<'a> AnyEventPayload for AnyEvent<'a>

Source§

const SOURCES: &'static [Option<&'static str>]

Source§

const EVENT_TYPES: &'static [u16]

Source§

impl<T: AnyEventPayload> AnyEventPayload for Event<T>

Source§

const SOURCES: &'static [Option<&'static str>] = T::SOURCES

Source§

const EVENT_TYPES: &'static [u16] = T::EVENT_TYPES

Source§

impl<T: EventPayload> AnyEventPayload for T

Source§

const SOURCES: &'static [Option<&'static str>]

Source§

const EVENT_TYPES: &'static [u16]