Element events #19

This commit is contained in:
2025-08-02 16:26:38 -05:00
parent e0ae338e15
commit ec3576e6db
4 changed files with 32 additions and 9 deletions
+6
View File
@@ -58,3 +58,9 @@ impl<E: Event> Debug for Handler<E> {
write!(f, "Handler({})", type_name::<E>())
}
}
impl<'a> dyn Event + 'a {
pub fn get<T: Event + 'static>(&self) -> Option<&T> {
self.as_any().downcast_ref()
}
}