TypedEventBase

Trait TypedEventBase 

Source
pub trait TypedEventBase:
    Send
    + Sync
    + Debug {
    // Required methods
    fn as_dict(&self) -> HashMap<String, Value>;
    fn as_any(&self) -> &dyn Any;

    // Provided methods
    fn is_callback_event(&self) -> bool { ... }
    fn prepare(&mut self, _invocation_state: &HashMap<String, Value>) { ... }
}
Expand description

Base trait for typed events.

Required Methods§

Source

fn as_dict(&self) -> HashMap<String, Value>

Convert to a raw dictionary for emitting purposes.

Source

fn as_any(&self) -> &dyn Any

Returns the event as Any for downcasting.

Provided Methods§

Source

fn is_callback_event(&self) -> bool

Whether this event should trigger the callback_handler.

Source

fn prepare(&mut self, _invocation_state: &HashMap<String, Value>)

Prepare the event for emission by adding invocation state.

Implementors§