Trait EntityEvent
Source pub trait EntityEvent:
Send
+ Sync
+ Debug {
type Id;
// Required methods
fn kind(&self) -> EventKind;
fn entity_id(&self) -> &Self::Id;
}
Expand description
Base trait for entity lifecycle events.
Generated event enums implement this trait, enabling generic
event handling and dispatching.
§Example
ⓘfn handle_event<E: EntityEvent>(event: &E) {
println!("Event {:?} for entity {:?}", event.kind(), event.entity_id());
}
Get the entity ID associated with this event.