ragnarok/
emmitable.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{
    NameOfEvent,
    NodeKey,
};

pub trait EmmitableEvent: Clone + PartialEq + Eq + Ord {
    type Name: NameOfEvent;
    type Key: NodeKey;

    /// Get the name of this event.
    fn name(&self) -> Self::Name;
    /// Get the name of the source event of this event. For example, the source event of a mouseenter would be mouse movement.
    fn source(&self) -> Self::Name;
    /// The node key targeted by this event.
    fn key(&self) -> Self::Key;
}