Trait Event

Source
pub trait Event: 'static {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn as_any_mut(&mut self) -> &mut dyn Any;
    fn event_type(&self) -> &'static str;
    fn box_clone(&self) -> Box<dyn Event>;
}
Expand description

Generic event trait

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Convert to Any for downcasting

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Convert to Any for downcasting (mutable)

Source

fn event_type(&self) -> &'static str

Get the event type name

Source

fn box_clone(&self) -> Box<dyn Event>

Clone the event

Implementors§

Source§

impl<T: Any + Clone + 'static> Event for T

Default implementation for types that implement Clone