Trait Eventable

Source
pub trait Eventable:
    Unpin
    + Send
    + Sync
    + 'static {
    // Required method
    fn data(&self) -> &str;

    // Provided methods
    fn event_type(&self) -> Option<&str> { ... }
    fn id(&self) -> Option<&str> { ... }
}
Expand description

A trait that allows any Unpin + Send + Sync type to act as an event.

For a concrete implementation of this trait, you can use Event, but it is also implemented for String and [&'static str].

Required Methods§

Source

fn data(&self) -> &str

return the data for this event. non-optional.

Provided Methods§

Source

fn event_type(&self) -> Option<&str>

return the event type, optionally

Source

fn id(&self) -> Option<&str>

return a unique event id, optionally

Implementations on Foreign Types§

Source§

impl Eventable for &'static str

Source§

fn data(&self) -> &str

Source§

impl Eventable for String

Source§

fn data(&self) -> &str

Implementors§