ragnarok/
emmitable.rs

1use crate::{
2    NameOfEvent,
3    NodeKey,
4};
5
6pub trait EmmitableEvent: Clone + PartialEq + Eq + Ord {
7    type Name: NameOfEvent;
8    type Key: NodeKey;
9
10    /// Get the name of this event.
11    fn name(&self) -> Self::Name;
12    /// Get the name of the source event of this event. For example, the source event of a mouseenter would be mouse movement.
13    fn source(&self) -> Self::Name;
14    /// The node key targeted by this event.
15    fn key(&self) -> Self::Key;
16}